/* styles.css - Complete shared styles for the website */

/* Define CSS variables for light and dark modes */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --header-bg: #f8f9fa;
    --header-text: #333333;
    --accent-color: #007bff;
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --header-bg: #1e1e1e;
    --header-text: #e0e0e0;
    --accent-color: #0d6efd;
}

/* General styles */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Banner and navigation */
.banner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem;
    background-color: var(--header-bg);
    color: var(--header-text);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.banner-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.banner-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-icon {
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--header-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

.nav-menu a.active {
    color: var(--accent-color);
    font-weight: 600;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.banner {
    padding: 1.2rem 1rem;
    min-height: 70px;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Page content */
.page-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.detail-page h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: var(--accent-color);
    text-align: center;
}

/* Detail grid - 2 columns */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    background: var(--header-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.detail-row.full-width,
.actions.full-width {
    grid-column: 1 / -1;
}

.detail-row label {
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.9;
    padding-top: 0.7rem;
}

.detail-row input,
.detail-row textarea,
.detail-row select {
    padding: 0.8rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
}

.detail-row input:focus,
.detail-row textarea:focus,
.detail-row select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.readonly {
    background-color: #f5f5f5 !important;
    color: #777;
    cursor: not-allowed;
}

body.dark-mode .readonly {
    background-color: #2a2a2a !important;
    color: #aaa;
}

/* Actions */
.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Messages */
.success-msg, .error-msg {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.success-msg {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-msg {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

body.dark-mode .success-msg {
    background-color: #1e4028;
    color: #a3e6b4;
    border-color: #2d6a3f;
}

body.dark-mode .error-msg {
    background-color: #442227;
    color: #f5a8b1;
    border-color: #6b2d34;
}

/* Project Options - final compact layout */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1rem;
}

.option-item {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.2rem;
    background: var(--bg-color);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    transition: border-color 0.3s ease;
}

.option-item:hover {
    border-color: var(--accent-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    font-size: 1.1rem;
}

.option-checkbox {
    width: 1.4rem;
    height: 1.4rem;
    cursor: pointer;
}

.option-name {
    font-weight: 600;
}

.custom-fields {
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 1rem;
}

.custom-fields.show {
    display: flex;
}

.input-with-revert {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.input-with-revert input.compact-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
}

.input-with-revert input.compact-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.revert-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.4s, color 0.3s;
    padding: 0.4rem;
}

.revert-btn:hover {
    opacity: 1;
    color: var(--accent-color);
    transform: rotate(360deg);
}

.revert-btn:disabled,
.compact-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Dark mode improvements for inputs and icons */
body.dark-mode .input-with-revert input.compact-input {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .input-with-revert input.compact-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.3);
}

body.dark-mode .revert-btn {
    color: #e0e0e0;
}

body.dark-mode .revert-btn:hover {
    color: var(--accent-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-fields {
        gap: 0.8rem;
    }
    
    .input-with-revert {
        flex-direction: column;
        align-items: stretch;
    }
    
    .revert-btn {
        align-self: flex-end;
    }
}