/* ===========================================
   TIME TRACKER - CSS STYLES
   =========================================== */

/* CSS Variables for theming */
:root {
    /* Starry Night Theme (Default) */
    --bg-gradient-start: #0f0c29;
    --bg-gradient-mid: #302b63;
    --bg-gradient-end: #24243e;

    --primary-color: #6c5ce7;
    --primary-hover: #5b4cdb;
    --secondary-color: #a29bfe;

    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.15);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    --success-color: #00b894;
    --danger-color: #ff7675;
    --warning-color: #fdcb6e;
    --info-color: #74b9ff;

    --table-header-bg: rgba(108, 92, 231, 0.3);
    --table-row-hover: rgba(255, 255, 255, 0.05);
    --table-border: rgba(255, 255, 255, 0.1);

    --input-bg: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.2);
    --input-focus-border: var(--primary-color);
}

/* Ocean Theme */
[data-theme="ocean"] {
    --bg-gradient-start: #0a1628;
    --bg-gradient-mid: #1a3a5c;
    --bg-gradient-end: #0d2137;

    --primary-color: #00cec9;
    --primary-hover: #00b5b0;
    --secondary-color: #81ecec;
}

/* Sunset Theme */
[data-theme="sunset"] {
    --bg-gradient-start: #2d1f3d;
    --bg-gradient-mid: #4a2c4a;
    --bg-gradient-end: #1a1a2e;

    --primary-color: #fd79a8;
    --primary-hover: #e66a97;
    --secondary-color: #fab1d0;
}

/* Forest Theme */
[data-theme="forest"] {
    --bg-gradient-start: #0d1f0d;
    --bg-gradient-mid: #1a3a1a;
    --bg-gradient-end: #0a1f15;

    --primary-color: #00b894;
    --primary-hover: #00a381;
    --secondary-color: #55efc4;
}

/* Minimal Light Theme */
[data-theme="light"] {
    --bg-gradient-start: #f5f6fa;
    --bg-gradient-mid: #dfe6e9;
    --bg-gradient-end: #f5f6fa;

    --primary-color: #6c5ce7;
    --primary-hover: #5b4cdb;
    --secondary-color: #a29bfe;

    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-muted: #b2bec3;

    --table-header-bg: rgba(108, 92, 231, 0.15);
    --table-row-hover: rgba(0, 0, 0, 0.03);
    --table-border: rgba(0, 0, 0, 0.1);

    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(0, 0, 0, 0.15);
}

/* ===========================================
   ANIMATED STARRY BACKGROUND
   =========================================== */

body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Stars Container */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255, 255, 255, 0.9), transparent);
    background-size: 200px 200px;
    animation: starsMove 100s linear infinite;
}

.stars:nth-child(2) {
    background-image:
        radial-gradient(1px 1px at 50px 60px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 80px 100px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 120px 50px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 170px 90px, rgba(255, 255, 255, 0.8), transparent);
    background-size: 300px 300px;
    animation: starsMove 150s linear infinite reverse;
}

.stars:nth-child(3) {
    background-image:
        radial-gradient(1px 1px at 30px 90px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(2px 2px at 70px 40px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 100px 130px, rgba(255, 255, 255, 0.5), transparent);
    background-size: 250px 250px;
    animation: starsMove 120s linear infinite;
}

@keyframes starsMove {
    from {
        transform: translateY(0) translateX(0);
    }

    to {
        transform: translateY(-100%) translateX(-50px);
    }
}

/* Hide stars on light theme */
[data-theme="light"] .stars-container {
    display: none;
}

/* ===========================================
   GLASSMORPHISM CARDS
   =========================================== */

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

/* ===========================================
   NAVBAR
   =========================================== */

.navbar {
    background: var(--card-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    color: var(--primary-color);
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.1);
}

/* ===========================================
   JUMBOTRON / TIMER SECTION
   =========================================== */

.timer-jumbotron {
    padding: 3rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.timer-jumbotron::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    opacity: 0.1;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.15;
    }
}

.timer-display {
    font-size: 5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--text-primary);
    text-shadow: 0 0 30px rgba(108, 92, 231, 0.5);
    margin: 1.5rem 0;
    letter-spacing: 0.1em;
    position: relative;
    z-index: 1;
}

.timer-status {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.timer-status.running {
    color: var(--success-color);
    animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.timer-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

/* ===========================================
   BUTTONS
   =========================================== */

.btn-glow {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-start {
    background: linear-gradient(135deg, var(--success-color), #00d9a6);
    color: white;
    box-shadow: 0 10px 30px rgba(0, 184, 148, 0.4);
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 184, 148, 0.5);
    color: white;
}

.btn-stop {
    background: linear-gradient(135deg, var(--danger-color), #ff8a80);
    color: white;
    box-shadow: 0 10px 30px rgba(255, 118, 117, 0.4);
}

.btn-stop:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 118, 117, 0.5);
    color: white;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    box-shadow: 0 5px 20px rgba(108, 92, 231, 0.3);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
    color: white;
}

.btn-outline-custom {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--card-border);
}

.btn-outline-custom:hover {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

/* ===========================================
   TABLE SECTION
   =========================================== */

.table-section {
    padding: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.filter-group .form-control-custom {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    width: auto;
    min-width: 120px;
}

.filter-group .text-secondary {
    font-size: 0.75rem;
    margin: 0 0.2rem;
}

.form-control-custom {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.form-control-custom:focus {
    background: var(--input-bg);
    border-color: var(--input-focus-border);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.form-control-custom::placeholder {
    color: var(--text-muted);
}

/* Table Styles */
.entries-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.entries-table thead th {
    background: var(--table-header-bg);
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border: none;
}

.entries-table thead th:first-child {
    border-radius: 10px 0 0 10px;
}

.entries-table thead th:last-child {
    border-radius: 0 10px 10px 0;
}

.entries-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--table-border);
    color: var(--text-primary);
    vertical-align: middle;
}

.entries-table tbody tr {
    transition: all 0.3s ease;
}

.entries-table tbody tr:hover {
    background: var(--table-row-hover);
}

/* Editable Fields */
.editable-field {
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.editable-field:hover {
    background: rgba(108, 92, 231, 0.2);
}

.editable-field i {
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.editable-field:hover i {
    opacity: 1;
}

.edit-input-group {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.edit-input-group.active {
    display: flex;
}

.edit-input {
    background: var(--input-bg);
    border: 1px solid var(--input-focus-border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.95rem;
    width: auto;
}

.edit-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.3);
}

.btn-save-edit,
.btn-cancel-edit {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save-edit {
    background: var(--success-color);
    color: white;
}

.btn-cancel-edit {
    background: var(--text-muted);
    color: white;
}

/* Notes Field */
.notes-field {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-edit-container {
    display: none;
}

.notes-edit-container.active {
    display: block;
}

.notes-textarea {
    width: 100%;
    min-height: 80px;
    background: var(--input-bg);
    border: 1px solid var(--input-focus-border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.6rem;
    resize: vertical;
}

.notes-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Duration Badge */
.duration-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Delete Button */
.btn-delete {
    color: var(--danger-color);
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    background: rgba(255, 118, 117, 0.2);
    color: var(--danger-color);
}

/* ===========================================
   MODALS
   =========================================== */

.modal-content {
    background: var(--bg-gradient-mid);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: 1px solid var(--card-border);
    padding: 1.5rem;
}

.modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

.btn-close {
    filter: invert(1);
    opacity: 0.7;
}

[data-theme="light"] .btn-close {
    filter: none;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--card-border);
    padding: 1.5rem;
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* ===========================================
   SETTINGS PAGE
   =========================================== */

.settings-section {
    margin-bottom: 2rem;
}

.settings-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--card-border);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.theme-card {
    padding: 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
}

.theme-card:hover {
    transform: translateY(-5px);
}

.theme-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.3);
}

.theme-preview {
    width: 100%;
    height: 80px;
    border-radius: 10px;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.theme-preview.starry-night {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
}

.theme-preview.ocean {
    background: linear-gradient(135deg, #0a1628, #1a3a5c, #0d2137);
}

.theme-preview.sunset {
    background: linear-gradient(135deg, #2d1f3d, #4a2c4a, #1a1a2e);
}

.theme-preview.forest {
    background: linear-gradient(135deg, #0d1f0d, #1a3a1a, #0a1f15);
}

.theme-preview.light {
    background: linear-gradient(135deg, #f5f6fa, #dfe6e9, #f5f6fa);
}

.theme-card-title {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

@media (max-width: 768px) {
    .timer-display {
        font-size: 3rem;
    }

    .timer-jumbotron {
        padding: 2rem 1rem;
    }

    .timer-buttons {
        flex-direction: column;
    }

    .btn-glow {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        justify-content: center;
    }

    .entries-table {
        font-size: 0.85rem;
    }

    .entries-table th,
    .entries-table td {
        padding: 0.75rem 0.5rem;
    }

    .editable-field {
        padding: 0.3rem 0.5rem;
    }
}

/* ===========================================
   UTILITIES
   =========================================== */

.z-1 {
    position: relative;
    z-index: 1;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.spinner-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

.toast-custom {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease;
}

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

    to {
        transform: translateX(0);
        opacity: 1;
    }
}