/* TimeVault - Premium Work Hours Tracker */
/* Complete Redesign - Modern Dark Theme */

:root {
    /* Color System */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #222230;
    --bg-input: #0f0f15;
    
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;
    --accent-purple: #a855f7;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-purple: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    --gradient-orange: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-dark: linear-gradient(180deg, #12121a 0%, #0a0a0f 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-md);
}

.toast.success { border-left: 4px solid var(--accent-green); }
.toast.error { border-left: 4px solid var(--accent-red); }
.toast.warning { border-left: 4px solid var(--accent-orange); }

.toast i { font-size: 1.1rem; }
.toast.success i { color: var(--accent-green); }
.toast.error i { color: var(--accent-red); }
.toast.warning i { color: var(--accent-orange); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* App Container */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 40px;
}

/* Header */
.app-header {
    text-align: center;
    padding: 30px 0 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.logo-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 
        0 0 0 3px rgba(99, 102, 241, 0.3),
        0 0 30px rgba(99, 102, 241, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.5);
    
    /* High quality rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    
    /* Smooth transitions */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05) translateZ(0);
    box-shadow: 
        0 0 0 4px rgba(99, 102, 241, 0.5),
        0 0 50px rgba(99, 102, 241, 0.6),
        0 12px 40px rgba(0, 0, 0, 0.6);
}

.app-title {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Responsive logo sizing */
@media (max-width: 768px) {
    .logo-image {
        width: 100px;
        height: 100px;
    }
    
    .app-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .logo-image {
        width: 80px;
        height: 80px;
    }
    
    .app-title {
        font-size: 1.5rem;
    }
    
    .app-header {
        padding: 20px 0 30px;
    }
}

/* High DPI / Retina display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-image {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Stats Dashboard */

/* Stats Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

.accent-green .stat-icon { background: var(--gradient-green); }
.accent-blue .stat-icon { background: var(--gradient-blue); }
.accent-purple .stat-icon { background: var(--gradient-purple); }
.accent-orange .stat-icon { background: var(--gradient-orange); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-unit {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Week Navigation */
.week-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.nav-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.today-btn {
    width: auto;
    padding: 0 16px;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.week-display {
    text-align: center;
}

.week-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.week-dates {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Week Grid - Day Cards */
.week-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.day-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 100px 1fr auto;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.day-card:hover {
    background: var(--bg-card-hover);
}

.day-card.today {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.day-card.has-hours {
    border-left: 4px solid var(--accent-green);
}

.day-info {
    display: flex;
    flex-direction: column;
}

.day-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.day-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.day-times {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.time-value {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.day-hours {
    text-align: right;
}

.hours-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-green);
}

.hours-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.day-card.no-hours .hours-value {
    color: var(--text-muted);
}

/* Quick Add Section */
.quick-add {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 25px;
    margin-bottom: 25px;
}

.quick-add h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-add h3 i {
    color: var(--accent-green);
}

.quick-add-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.time-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group input,
.input-group select {
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--border-focus);
}

.calculated-hours {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.calc-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.calc-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
}

/* Adjustment Section */
.adjustment-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 25px;
    margin-bottom: 25px;
}

.adjustment-section h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.adjustment-section h3 i {
    color: var(--accent-blue);
}

.adjustment-form {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.adjustment-form .input-group {
    flex: 1;
    min-width: 150px;
}

.adjustment-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.adj-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.adj-btn.minus:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.adj-btn.plus:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.adjustment-controls input {
    width: 70px;
    text-align: center;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.adj-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Weekly Chart */
.weekly-chart {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 25px;
    margin-bottom: 25px;
}

.weekly-chart h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.weekly-chart h3 i {
    color: var(--accent-purple);
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    padding: 0 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.bar {
    width: 30px;
    background: var(--gradient-green);
    border-radius: 4px 4px 0 0;
    transition: var(--transition);
    min-height: 4px;
}

.bar.overtime {
    background: var(--gradient-orange);
}

.bar:hover {
    opacity: 0.8;
}

.bar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.bar-value {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.regular { background: var(--accent-green); }
.dot.overtime { background: var(--accent-orange); }

/* Actions */
.actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

/* Footer */
.app-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.app-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.credit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    max-width: 450px;
    width: 100%;
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    background: var(--gradient-primary);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.2rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

.setting-group {
    margin-bottom: 18px;
}

.setting-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.setting-group label i {
    color: var(--accent-primary);
    width: 20px;
}

.setting-group input,
.setting-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
}

.setting-group input:focus,
.setting-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.modal-footer {
    padding: 15px 25px;
    background: var(--bg-secondary);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .day-card {
        grid-template-columns: 80px 1fr;
        gap: 15px;
    }
    
    .day-times {
        display: none;
    }
    
    .day-hours {
        grid-column: 2;
        text-align: left;
    }
    
    .time-inputs {
        grid-template-columns: 1fr 1fr;
    }
    
    .time-inputs .input-group:last-child {
        grid-column: span 2;
    }
    
    .adjustment-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .adjustment-controls {
        justify-content: center;
    }
    
    .bar-chart {
        height: 120px;
    }
    
    .bar {
        width: 24px;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 15px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .stats-dashboard {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .week-nav {
        gap: 10px;
    }
    
    .week-dates {
        font-size: 0.95rem;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .actions .btn {
        width: 100%;
    }
}

/* Select dropdown styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.day-card {
    animation: fadeIn 0.3s ease forwards;
}

.day-card:nth-child(1) { animation-delay: 0.05s; }
.day-card:nth-child(2) { animation-delay: 0.1s; }
.day-card:nth-child(3) { animation-delay: 0.15s; }
.day-card:nth-child(4) { animation-delay: 0.2s; }
.day-card:nth-child(5) { animation-delay: 0.25s; }
.day-card:nth-child(6) { animation-delay: 0.3s; }
.day-card:nth-child(7) { animation-delay: 0.35s; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

/* Edit Modal Specifics */
#edit-date-label {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.modal-body .time-inputs {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 20px;
}

.modal-body .calculated-hours {
    margin-top: 20px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}