:root {
    --color-primary: #1a2b4c;
    /* Dark Navy/Grey */
    --color-accent: #D0103A;
    /* Skyscape Crimson Red */
    --color-secondary: #0099D8;
    /* Cyan Blue */
    --color-text-main: #2d3748;
    /* Soft black/dark grey */
    --color-background: #f8fafc;
    /* Light background */
    --color-white: #ffffff;
    --color-light-grey: #e2e8f0;
}

/* Collapsible Top Bar */
.top-bar {
    background: linear-gradient(90deg, var(--color-primary) 0%, #2d3b5c 100%);
    color: var(--color-white);
    padding: 10px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(26, 43, 76, 0.2);
    position: relative;
    z-index: 9999;
    overflow: hidden;
    max-height: 300px;
    /* was 80px – allows mobile stacking */
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-bar.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    box-shadow: none;
}

.bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.bar-text {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    /* Allows text truncation */
}

.bar-icon {
    font-size: 1.4rem;
    color: var(--color-secondary);
    flex-shrink: 0;
}

.bar-message {
    font-size: 1.05rem;
    line-height: 1.4;
    overflow: hidden;
}

.bar-message strong {
    font-weight: 700;
    color: var(--color-white);
}

.bar-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cta-button {
    background-color: var(--color-accent);
    color: var(--color-white);
    border: none;
    padding: 7px 22px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.cta-button:hover {
    background-color: #b80e32;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(208, 16, 58, 0.3);
}

.close-bar {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 0 0 15px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.close-bar:hover {
    color: var(--color-white);
}

.toggle-bar {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    width: 36px;
    height: 18px;
    border-radius: 0 0 8px 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 9998;
    /* Just below top-bar but above content */
}

.toggle-bar:hover {
    background-color: #16203a;
    height: 22px;
}

.toggle-bar i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.top-bar.collapsed+.toggle-bar i {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .top-bar {
        padding: 12px 20px;
    }

    .bar-content {
        flex-direction: column;
        gap: 12px;
    }

    .bar-text {
        flex-direction: row;
        gap: 10px;
        min-width: 100%;
    }

    .bar-message {
        font-size: 1rem;
        text-align: center;
    }

    .bar-cta {
        width: 100%;
        justify-content: space-between;
    }

    .cta-button {
        padding: 10px 20px;
        flex-grow: 1;
    }

    .close-bar {
        padding: 0 0 0 15px;
    }

    .content {
        padding: 25px;
    }

    .controls {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .bar-text {
        flex-direction: column;
        gap: 8px;
    }

    .bar-message {
        font-size: 0.95rem;
        line-height: 1.3;
        word-break: break-word;
    }

    .cta-button {
        padding: 9px 15px;
        font-size: 0.9rem;
    }

    .close-bar {
        position: static;
        padding-left: 10px;
    }

    .toggle-bar {
        width: 40px;
        height: 20px;
    }

    .controls {
        flex-direction: column;
    }

    .control-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .bar-message {
        font-size: 0.85rem;

    }

    .cta-button span {
        display: none;
    }

    .cta-button i {
        font-size: 1.2rem;
        margin-right: 0;
    }

    .cta-button {
        padding: 10px 12px;
        white-space: normal;
        /* allow wrapping if needed */
        justify-content: center;
    }

    .cta-button .button-text {
        display: none;
    }

    .cta-button {
        padding: 10px;
    }

    .cta-button i {
        margin: 0;
    }

}

/* Text truncation for very small screens */
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}