/* ===== CSS Variables ===== */
:root {
    /* Gold Colors */
    --gold-primary: #D4AF37;
    --gold-light: #FFD700;
    --gold-dark: #B8941E;
    --gold-glow: rgba(212, 175, 55, 0.3);

    /* Blue-Black Colors */
    --blue-black-dark: #0A1628;
    --blue-black-medium: #1A2332;
    --blue-black-light: #2A3442;
    --blue-black-lighter: #3A4552;

    /* Accent Colors */
    --white: #FFFFFF;
    --white-soft: #F5F5F5;
    --shadow-gold: 0 8px 32px rgba(212, 175, 55, 0.15);
    --shadow-dark: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--blue-black-dark) 0%, var(--blue-black-medium) 50%, var(--blue-black-dark) 100%);
    color: var(--white);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.container {
    max-width: 1200px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

/* ===== Logo ===== */
.logo-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    max-width: 150px;
    height: auto;
    filter: drop-shadow(0 0 20px var(--gold-glow));
    mix-blend-mode: lighten;
    background: transparent;
    border-radius: 10px;
}

.title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 30px var(--gold-glow);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--gold-primary);
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ===== Main Content ===== */
.main-content {
    background: rgba(26, 35, 50, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    box-shadow: var(--shadow-dark), 0 0 0 1px rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    animation: fadeInUp 0.8s ease-out;
}

/* ===== Current Timer ===== */
.current-timer {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
    border-radius: 20px;
    border: 2px solid var(--gold-primary);
    box-shadow: 0 0 40px var(--gold-glow);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 40px var(--gold-glow);
    }

    50% {
        box-shadow: 0 0 60px var(--gold-glow), 0 0 80px var(--gold-glow);
    }
}

.timer-label {
    font-size: 1.5rem;
    color: var(--gold-light);
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    max-height: 100px;
    opacity: 1;
}

.timer-label.hidden {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

.timer-display {
    font-size: 6rem;
    font-weight: 700;
    color: var(--white);
    font-family: 'Inter', monospace;
    margin-bottom: 30px;
    text-shadow: 0 0 20px var(--gold-glow);
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: var(--blue-black-light);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold-dark) 0%, var(--gold-light) 50%, var(--gold-dark) 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    animation: shimmer 2s linear infinite;
    box-shadow: 0 0 20px var(--gold-glow);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===== Controls ===== */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-light) 100%);
    color: var(--blue-black-dark);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 25px var(--gold-glow);
}

.btn-secondary {
    background: var(--blue-black-light);
    color: var(--white);
    border: 1px solid var(--gold-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--blue-black-lighter);
    border-color: var(--gold-light);
}

.btn-accent {
    background: linear-gradient(135deg, var(--blue-black-medium) 0%, var(--blue-black-light) 100%);
    color: var(--gold-light);
    border: 2px solid var(--gold-primary);
}

.btn-accent:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--blue-black-light) 0%, var(--blue-black-lighter) 100%);
    box-shadow: 0 6px 25px var(--gold-glow);
}

.btn svg {
    width: 20px;
    height: 20px;
}

/* ===== Tab Navigation ===== */
.tab-navigation {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--gold-primary);
    background: transparent;
    color: var(--gold-primary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tab-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-light) 100%);
    color: var(--blue-black-dark);
    box-shadow: 0 0 20px var(--gold-glow);
}

/* ===== Tab Content ===== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Segments ===== */
.segments {
    margin-top: 40px;
}

.segments-title {
    font-size: 1.8rem;
    color: var(--gold-primary);
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 2px;
}

.segment-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.segment {
    background: rgba(42, 52, 66, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.segment:hover {
    transform: translateY(-5px);
    border-color: var(--gold-primary);
    box-shadow: 0 8px 25px var(--gold-glow);
}

.segment.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.1) 100%);
    border: 2px solid var(--gold-primary);
    box-shadow: 0 0 30px var(--gold-glow);
}

.segment.completed {
    opacity: 0.6;
    background: rgba(42, 52, 66, 0.3);
}

.segment.completed .segment-status {
    color: #4CAF50;
}

.segment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.segment-icon {
    font-size: 1.8rem;
}

.segment-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
}

.segment-duration {
    font-size: 0.95rem;
    color: var(--gold-primary);
    margin-bottom: 8px;
    font-weight: 500;
}

.segment-status {
    font-size: 0.85rem;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ===== Custom Form ===== */
.custom-form {
    background: rgba(42, 52, 66, 0.4);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--gold-primary);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    background: var(--blue-black-light);
    border: 1px solid var(--gold-primary);
    border-radius: 8px;
    color: var(--white);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold-light);
    box-shadow: 0 0 15px var(--gold-glow);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ===== Custom Segments List ===== */
.custom-segments-list {
    min-height: 100px;
    margin-bottom: 20px;
}

.custom-segment-item {
    background: rgba(42, 52, 66, 0.5);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

.custom-segment-item:hover {
    border-color: var(--gold-primary);
    box-shadow: 0 4px 15px var(--gold-glow);
}

.custom-segment-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.custom-segment-icon {
    font-size: 1.5rem;
}

.custom-segment-details {
    display: flex;
    flex-direction: column;
}

.custom-segment-name {
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
}

.custom-segment-duration {
    font-size: 0.9rem;
    color: var(--gold-primary);
}

.delete-btn {
    padding: 8px 15px;
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid #FF3B30;
    color: #FF3B30;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: rgba(255, 59, 48, 0.4);
    transform: scale(1.05);
}

/* ===== Custom Actions ===== */
.custom-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: var(--gold-primary);
    font-size: 1rem;
    opacity: 0.8;
}

/* ===== Fullscreen Mode ===== */
body.fullscreen-mode .controls,
body.fullscreen-mode .tab-navigation,
body.fullscreen-mode .segments,
body.fullscreen-mode .footer,
body.fullscreen-mode .title,
body.fullscreen-mode .subtitle {
    display: none !important;
}

body.fullscreen-mode .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px;
}

body.fullscreen-mode .header {
    margin-bottom: 60px;
}

body.fullscreen-mode .logo {
    max-width: 200px;
}

body.fullscreen-mode .main-content {
    width: 100%;
    max-width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

body.fullscreen-mode .current-timer {
    padding: 60px;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    animation: none;
}

body.fullscreen-mode .timer-label {
    font-size: 3rem;
    margin-bottom: 40px;
}

body.fullscreen-mode .timer-display {
    font-size: 15rem;
    margin: 0;
}

body.fullscreen-mode .progress-bar-container {
    display: none;
}

/* ===== Animations ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .logo {
        max-width: 120px;
    }

    .timer-display {
        font-size: 4rem;
    }

    .main-content {
        padding: 25px;
    }

    .current-timer {
        padding: 25px;
    }

    .controls {
        gap: 10px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .segment-list {
        grid-template-columns: 1fr;
    }

    .tab-navigation {
        flex-direction: column;
    }

    body.fullscreen-mode .timer-display {
        font-size: 8rem;
    }

    body.fullscreen-mode .timer-label {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .logo {
        max-width: 100px;
    }

    .timer-display {
        font-size: 3rem;
    }

    .timer-label {
        font-size: 1.2rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .custom-form {
        padding: 20px;
    }

    body.fullscreen-mode .timer-display {
        font-size: 5rem;
    }

    body.fullscreen-mode .timer-label {
        font-size: 1.5rem;
    }

    body.fullscreen-mode .logo {
        max-width: 150px;
    }
}