:root {
    --primary-color: #800020;
    --primary-light: #a3436b;
    --primary-dark: #5c0018;
    --secondary-color: #d4af37;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --light-color: #f8f9fa;
    --dark-color: #212121;
    --gray-color: #757575;
    --light-gray: #e0e0e0;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #800020;
    --primary-light: #5c0018;
    --primary-dark: #3a000f;
    --light-color: #121212;
    --dark-color: #e0e0e0;
    --gray-color: #9e9e9e;
    --light-gray: #424242;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    transition: var(--transition);
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Logo */
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

/* Back Button */
.back-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.back-btn:hover {
    background-color: rgba(128, 0, 32, 0.1);
}

/* Homepage Styles */
.homepage {
    min-height: 100vh;
}

.home-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--light-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
    padding-right: 2rem;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--gray-color);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-image {
    flex: 1;
    max-width: 500px;
}

.hero-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 4rem 2rem;
    background-color: var(--light-gray);
    flex-wrap: wrap;
}

.feature-card {
    background-color: var(--light-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    width: 300px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.feature-card p {
    color: var(--gray-color);
}

/* ================= NEW AUTH LAYOUT STYLES ================= */
.auth-container {
    min-height: 100vh;
    padding: 20px;
    position: relative;
    background-color: var(--light-gray);
}

.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 40px);
}

.auth-box {
    flex: 1;
    max-width: 450px;
    background-color: var(--light-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    animation: fadeIn 0.5s ease;
}

.auth-image-container {
    flex: 1;
    display: none;
    text-align: center;
    animation: fadeInRight 0.6s ease-out;
}

.auth-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-height: 70vh;
    object-fit: contain;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-size: 2rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    justify-content: center;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--gray-color);
    position: relative;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: bold;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-btn:hover:not(.active) {
    background-color: rgba(128, 0, 32, 0.05);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Increased gap for better spacing */
}

.form-group {
    display: flex;
    flex-direction: column;
    width: 100%; /* Ensure full width within auth-box */
    max-width: 100%; /* Removed fixed max-width to allow flexibility */
}

.form-group label {
    font-weight: 600; /* Slightly bolder for emphasis */
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.form-group input {
    padding: 0.75rem; /* Increased padding for better input size */
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    width: 100%; /* Ensure inputs fill the container */
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(128, 0, 32, 0.2);
}

.forgot-password {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive adjustments */
@media (min-width: 992px) {
    .auth-image-container {
        display: block;
    }
    
    .auth-box {
        padding: 3rem;
    }
}

@media (max-width: 768px) {
    .auth-layout {
        padding: 1rem;
        flex-direction: column;
        gap: 2rem;
    }
    
    .auth-box {
        padding: 2rem;
        max-width: 100%;
    }
    
    .auth-header {
        font-size: 1.75rem;
    }
    
    .form-group input {
        padding: 0.65rem; /* Slight adjustment for mobile */
    }
}

/* ================ REST OF YOUR EXISTING STYLES ================ */
/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Main App Styles */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--box-shadow);
    position: relative;
}

#main-back-btn {
    color: white;
    margin-right: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#welcome-message {
    font-weight: 500;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* App Content */
.app-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    padding: 1.5rem;
    background-color: var(--light-gray);
    border-right: 1px solid var(--light-gray);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.task-filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-filters h3 {
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--dark-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    background-color: rgba(128, 0, 32, 0.1);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.filter-btn[data-filter="high"]::before,
.filter-btn[data-sort="priority"]::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--danger-color);
}

.filter-btn[data-filter="medium"]::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--warning-color);
}

.filter-btn[data-filter="low"]::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--success-color);
}

.task-list-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.task-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-box {
    position: relative;
    width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
}

.search-box i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-color);
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 300px;
}

.no-tasks {
    text-align: center;
    color: var(--gray-color);
    padding: 2rem;
}

.task-card {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-left: 4px solid;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

[data-theme="dark"] .task-card {
    background-color: #2a2a2a;
}

.task-card.high-priority {
    border-left-color: var(--danger-color);
}

.task-card.medium-priority {
    border-left-color: var(--warning-color);
}

.task-card.low-priority {
    border-left-color: var(--success-color);
}

.task-card.overdue {
    border-left-color: var(--danger-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.task-checkbox {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.task-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.task-priority {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.task-priority.high {
    background-color: var(--danger-color);
}

.task-priority.medium {
    background-color: var(--warning-color);
}

.task-priority.low {
    background-color: var(--success-color);
}

.task-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--dark-color);
    margin: 0;
    padding: 0;
}

.task-title.completed {
    text-decoration: line-through;
    color: var(--gray-color);
    opacity: 0.7;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

.task-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-color);
    transition: var(--transition);
}

.task-actions button:hover {
    color: var(--primary-color);
}

.task-description {
    color: var(--gray-color);
    margin-bottom: 1rem;
}

.task-category {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    background-color: rgba(128, 0, 32, 0.1);
}

.task-attachment {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    text-decoration: none;
}

.task-attachment:hover {
    text-decoration: underline;
}

[data-theme="dark"] .task-description {
    color: #b0b0b0;
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.task-due-date {
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    background-color: var(--light-gray);
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-due-date.overdue {
    background-color: var(--danger-color);
    color: white;
}

.task-status {
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    text-transform: capitalize;
}

.task-status.not-started {
    background-color: rgba(117, 117, 117, 0.1);
    color: var(--gray-color);
}

.task-status.in-progress {
    background-color: rgba(255, 152, 0, 0.1);
    color: var(--warning-color);
}

.task-status.completed {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--light-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--box-shadow);
    position: relative;
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--dark-color);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

/* Task History */
.task-history-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.task-history-item:last-child {
    border-bottom: none;
}

/* Dashboard */
#dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

#task-stats-chart {
    max-width: 400px;
    margin: 0 auto;
}

/* Footer Styles */
.app-footer {
    padding: 20px;
    text-align: center;
    background-color: var(--light-gray);
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .hero-content {
        padding-right: 0;
        margin-bottom: 2rem;
    }
    
    .hero-image {
        max-width: 100%;
    }
    
    .features {
        flex-direction: column;
        align-items: center;
    }
    
    .app-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--light-gray);
    }
    
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .task-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .search-box {
        width: 100%;
    }
    
    .header-left, .header-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .app-header {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
}