* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    /* Light Mode Colors */
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --accent: #f72585;
    --success: #4cc9f0;
    --warning: #f8961e;
    --dark: #1d3557;
    --darker: #14213d;
    --light: #f8f9fa;
    --gray: #6c757d;
    --card-bg: rgba(255, 255, 255, 0.1);
    --border-radius: 16px;
    --box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --high-priority: #ff6b6b;
    --medium-priority: #ffd166;
    --low-priority: #06d6a0;
    
    /* Theme Colors */
    --bg-primary: #14213d;
    --bg-secondary: #1d3557;
    --text-primary: #f8f9fa;
    --text-secondary: #6c757d;
    --card-bg-color: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(0, 0, 0, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.15);
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #e9ecef;
    --text-primary: #1d3557;
    --text-secondary: #495057;
    --card-bg-color: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg-color);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px var(--shadow-color);
}

header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.app-title {
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--primary-light), var(--success));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}

.app-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    flex: 1;
}

@media (max-width: 1000px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--card-bg-color);
    border-radius: var(--border-radius);
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    color: var(--text-primary);
    font-size: 1.6rem;
}

.panel-title i {
    color: var(--success);
    background: rgba(76, 201, 240, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Section Titles */
.section-title {
    margin: 20px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.section-title h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

/* Task Section */
.task-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.task-input {
    flex: 1;
    min-width: 200px;
    padding: 16px 20px;
    border-radius: 50px;
    border: none;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.task-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
}

.priority-select {
    padding: 0 15px;
    border-radius: 50px;
    border: none;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1rem;
    border: 2px solid var(--border-color);
    cursor: pointer;
}

.add-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-btn:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
}

.task-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
    flex: 1;
    margin-bottom: 20px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--input-bg);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    animation: fadeIn 0.4s ease;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.task-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-timestamp {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 5px;
    font-style: italic;
}

.priority-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 15px;
}

.priority-high {
    background-color: var(--high-priority);
    box-shadow: 0 0 10px var(--high-priority);
}

.priority-medium {
    background-color: var(--medium-priority);
    box-shadow: 0 0 10px var(--medium-priority);
}

.priority-low {
    background-color: var(--low-priority);
    box-shadow: 0 0 10px var(--low-priority);
}

.task-check {
    margin-right: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.task-check.checked {
    background: var(--success);
    border-color: var(--success);
}

.task-check i {
    display: none;
    font-size: 0.8rem;
}

.task-check.checked i {
    display: block;
    color: white;
}

.task-text {
    flex: 1;
    font-size: 1.1rem;
    color: var(--text-primary);
    word-break: break-word;
}

.task-actions {
    display: flex;
    gap: 10px;
}

.task-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.task-btn.edit {
    display: block;
}

.task-btn.edit:hover {
    background: rgba(67, 97, 238, 0.2);
    color: var(--primary);
}

.task-btn.delete:hover {
    background: rgba(247, 37, 133, 0.2);
    color: var(--accent);
}

/* Timer Section */
.timer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 20px;
}

.timer-card {
    background: var(--input-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.timer-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.timer-title i {
    color: var(--success);
}

.time-display {
    font-size: 3.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin: 20px 0;
    color: var(--text-primary);
    text-shadow: 0 0 15px rgba(76, 201, 240, 0.7);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.timer-btn {
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-light);
    transform: translateY(-3px);
}

.btn-danger {
    background: var(--accent);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #ff4d91;
    transform: translateY(-3px);
}

.btn-success {
    background: var(--success);
    color: var(--darker);
    font-weight: 700;
}

.btn-success:hover:not(:disabled) {
    background: #3bd5ff;
    transform: translateY(-3px);
}

.input-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
}

.time-input {
    width: 80px;
    padding: 15px;
    text-align: center;
    font-size: 1.3rem;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.time-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
}

.time-label {
    display: block;
    text-align: center;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.motivation {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: rgba(76, 201, 240, 0.1);
    border-radius: var(--border-radius);
    font-style: italic;
    border: 1px solid rgba(76, 201, 240, 0.2);
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.stat-card {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Weekly Goals Section */
.goal-form {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.goal-input {
    flex: 1;
    padding: 16px 20px;
    border-radius: 50px;
    border: none;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.goal-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
}

.goal-list {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 10px;
    flex: 1;
    margin-bottom: 20px;
}

.goal-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--input-bg);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.goal-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px var(--shadow-color);
}

.goal-item.completed .goal-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.goal-text {
    flex: 1;
    font-size: 1.1rem;
    color: var(--text-primary);
    word-break: break-word;
}

.goal-timestamp {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 5px;
    font-style: italic;
}

.goal-check {
    margin-right: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.goal-check.checked {
    background: var(--success);
    border-color: var(--success);
}

.goal-check i {
    display: none;
    font-size: 0.8rem;
}

.goal-check.checked i {
    display: block;
    color: white;
}

.progress-container {
    height: 12px;
    background: var(--input-bg);
    border-radius: 10px;
    margin: 25px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--success);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-top: 10px;
}

/* Data Management Section */
.data-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.data-btn {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 15px;
    border-radius: 50px;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.data-btn.export {
    background: rgba(76, 201, 240, 0.2);
    color: var(--text-primary);
    border: 1px solid rgba(76, 201, 240, 0.3);
}

.data-btn.export:hover {
    background: rgba(76, 201, 240, 0.3);
    transform: translateY(-2px);
}

.data-btn.import {
    background: rgba(76, 201, 240, 0.2);
    color: var(--text-primary);
    border: 1px solid rgba(76, 201, 240, 0.3);
}

.data-btn.import:hover {
    background: rgba(76, 201, 240, 0.3);
    transform: translateY(-2px);
}

.data-btn.reset {
    background: rgba(220, 53, 69, 0.2);
    color: var(--text-primary);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.data-btn.reset:hover {
    background: rgba(220, 53, 69, 0.3);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--input-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

.pro-tip {
    background: rgba(76, 201, 240, 0.1);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-top: 20px;
    border-left: 3px solid var(--success);
}

.pro-tip i {
    color: var(--success);
    margin-right: 10px;
}

.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.help-content {
    background: var(--card-bg-color);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--border-radius);
    padding: 30px;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Task Editing */
.task-edit-input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid var(--primary);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1.1rem;
    outline: none;
}

/* Success Notification */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: var(--darker);
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 5px 15px var(--shadow-color);
    display: none;
    z-index: 3000;
    animation: fadeIn 0.3s ease;
}

.notification.show {
    display: block;
}

.notification.error {
    background: var(--accent);
    color: white;
}

/* Loading indicator for PDF operations */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .app-grid {
        gap: 15px;
    }
    
    .panel {
        padding: 20px;
    }
    
    .app-title {
        font-size: 2.2rem;
    }
    
    .time-display {
        font-size: 2.8rem;
    }
    
    .input-group {
        gap: 10px;
    }
    
    .time-input {
        width: 70px;
        font-size: 1.1rem;
        padding: 12px;
    }
    
    .task-form, .goal-form {
        flex-direction: column;
    }
    
    .add-btn {
        justify-content: center;
        padding: 15px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .data-controls {
        flex-direction: column;
    }
    
    .data-btn {
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.8rem;
    }
    
    .time-display {
        font-size: 2.2rem;
    }
    
    .timer-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .panel-title {
        font-size: 1.4rem;
    }
    
    .panel-title i {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .task-input, .goal-input {
        padding: 14px 18px;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
}
