/* CSS Variables for Dark Theme (Default) */
:root {
    /* SJ Design Brand Colors */
    --primary-teal: #4bb8b8;
    --primary-tan: #f0ebe9;
    --primary-teal-dark: #2a8f8f;
    --primary-tan-dark: #d4d0cf;
    
    /* Dark Theme Colors (Default) */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e8e8e8;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border-color: #404040;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
    --shadow-heavy: rgba(0, 0, 0, 0.6);
    
    /* Status Colors for Dark Mode */
    --status-active: #1e4a2e;
    --status-active-text: #4ade80;
    --status-on-hold: #4a3c1e;
    --status-on-hold-text: #fbbf24;
    --status-completed: #1e3a4a;
    --status-completed-text: #60a5fa;
    --status-pending: #4a3c1e;
    --status-pending-text: #fbbf24;
    --status-in-progress: #1e4a2e;
    --status-in-progress-text: #4ade80;
    --status-waiting: #4a1e1e;
    --status-waiting-text: #f87171;
    
    /* Priority Colors for Dark Mode */
    --priority-high: #dc2626;
    --priority-medium: #d97706;
    --priority-low: #16a34a;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Logo Styles */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.logo {
    height: 40px;
    width: auto;
    max-width: 200px;
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-teal-dark) 100%);
}

.login-container {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px var(--shadow-heavy);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-form {
    margin-bottom: 1rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-teal);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(50, 168, 168, 0.1);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-teal-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(50, 168, 168, 0.3);
}

.error-message {
    color: var(--priority-high);
    font-size: 0.9rem;
    margin-top: 1rem;
    display: none;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

.hidden {
    display: none !important;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px var(--shadow-light);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-header h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.nav-item:hover {
    color: var(--primary-teal);
    background: var(--bg-tertiary);
}

.nav-item.active {
    color: var(--primary-teal);
    background: rgba(50, 168, 168, 0.1);
    border-right: 3px solid var(--primary-teal);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.logout-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--priority-high);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 6px;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    background: var(--bg-secondary);
    padding: 2rem 2.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.header-left p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.content-area {
    flex: 1;
    padding: 2rem 2.5rem;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Content Toolbar */
.content-toolbar {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.toolbar-left h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    flex: 1;
    min-width: 150px;
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 3px solid var(--primary-teal);
}

.stat-icon {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-teal-dark) 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.stat-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px var(--shadow-light);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-teal);
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.project-card.high-priority {
    border-left-color: var(--priority-high);
}

.project-card.medium-priority {
    border-left-color: var(--priority-medium);
}

.project-card.low-priority {
    border-left-color: var(--priority-low);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.project-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.project-status.active {
    background: var(--status-active);
    color: var(--status-active-text);
}

.project-status.on-hold {
    background: var(--status-on-hold);
    color: var(--status-on-hold-text);
}

.project-status.completed {
    background: var(--status-completed);
    color: var(--status-completed-text);
}

.project-url {
    color: var(--primary-teal);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: block;
    font-weight: 500;
}

.project-url:hover {
    text-decoration: underline;
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.project-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Tasks Table */
.tasks-table-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-light);
    overflow: hidden;
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
}

.tasks-table th {
    background: var(--bg-tertiary);
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.tasks-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.tasks-table tr:hover {
    background: var(--bg-tertiary);
}

.task-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.task-project {
    font-size: 0.85rem;
    color: var(--primary-teal);
    font-weight: 500;
}

.task-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.task-status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.task-status.pending {
    background: var(--status-pending);
    color: var(--status-pending-text);
}

.task-status.in-progress {
    background: var(--status-in-progress);
    color: var(--status-in-progress-text);
}

.task-status.waiting {
    background: var(--status-waiting);
    color: var(--status-waiting-text);
}

.task-status.completed {
    background: var(--status-completed);
    color: var(--status-completed-text);
}

.task-priority {
    font-weight: 500;
}

.task-priority.high {
    color: var(--priority-high);
}

.task-priority.medium {
    color: var(--priority-medium);
}

.task-priority.low {
    color: var(--priority-low);
}

.task-due-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.task-due-date.overdue {
    color: var(--priority-high);
    font-weight: 600;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

/* Reminders Grid */
.reminders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
}

.reminder-item {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px var(--shadow-light);
    border-left: 4px solid var(--priority-medium);
}

.reminder-item.overdue {
    border-left-color: var(--priority-high);
    background: rgba(231, 76, 60, 0.05);
}

.reminder-item.upcoming {
    border-left-color: var(--priority-low);
    background: rgba(39, 174, 96, 0.05);
}

.reminder-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.reminder-datetime {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.reminder-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.reminder-project {
    font-size: 0.85rem;
    color: var(--primary-teal);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.reminder-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Settings */
.settings-container {
    max-width: 800px;
}

.settings-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px var(--shadow-light);
}

.settings-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.settings-form {
    max-width: 500px;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-teal);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(50, 168, 168, 0.1);
}

/* Checkbox Styles */
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0;
    cursor: pointer;
    opacity: 0;
    position: absolute;
}

.checkmark {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-teal);
    border-color: var(--primary-teal);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-teal-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(50, 168, 168, 0.3);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-muted);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--priority-high);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px var(--shadow-heavy);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.modal form {
    padding: 2rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-heavy);
    border-left: 4px solid var(--priority-low);
    z-index: 1001;
    animation: slideIn 0.3s ease;
    max-width: 400px;
    color: var(--text-primary);
}

.notification.error {
    border-left-color: var(--priority-high);
}

.notification.info {
    border-left-color: var(--primary-teal);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .content-area {
        padding: 1.5rem;
    }
    
    .content-header {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: column;
        padding: 1rem;
    }
    
    .sidebar-header {
        margin-bottom: 1rem;
    }
    
    .sidebar-header h2 {
        display: none; /* Hide "Project Manager" text on mobile */
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0;
    }
    
    .nav-item {
        padding: 1rem;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        background: var(--bg-secondary);
        transition: all 0.3s ease;
    }
    
    .nav-item.active {
        background: var(--primary-teal);
        color: white;
        border-color: var(--primary-teal);
    }
    
    .nav-item:hover {
        background: var(--bg-tertiary);
    }
    
    .nav-item.active:hover {
        background: var(--primary-teal-dark);
    }
    
    /* Hide Reminders and Settings on mobile */
    .nav-item[data-tab="reminders"],
    .nav-item[data-tab="settings"] {
        display: none;
    }
    
    .sidebar-footer {
        border-top: 1px solid var(--border-color);
        border-left: none;
        flex-direction: column;
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .content-header {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .content-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .toolbar-right {
        justify-content: space-between;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        display: flex;
        flex-wrap: wrap;
    }
    
    .stat-card {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }
    
    .reminders-grid {
        grid-template-columns: 1fr;
    }
    
    .tasks-table-container {
        overflow-x: auto;
    }
    
    .tasks-table {
        min-width: 600px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .project-actions {
        justify-content: center;
    }
    
    .reminder-actions {
        justify-content: center;
    }
}
