/**
 * Announcement System Styles
 * Styles for announcement bar and modal
 */

/* ==============================================
   Announcement Bar
   ============================================== */

.sa-announcement-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #ffffff;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.sa-announcement-bar.hidden {
    transform: translateY(-100%);
}

.sa-bar-item {
    position: relative;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.sa-bar-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.sa-bar-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sa-bar-button {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.sa-bar-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.sa-bar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

.sa-bar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sa-bar-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.sa-bar-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sa-bar-counter {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.sa-bar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.sa-bar-close:hover {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sa-bar-item {
        padding: 10px 15px;
        flex-wrap: wrap;
    }

    .sa-bar-content {
        width: 100%;
        margin-bottom: 8px;
    }

    .sa-bar-text {
        font-size: 13px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .sa-bar-button {
        font-size: 12px;
        padding: 5px 12px;
    }

    .sa-bar-controls {
        margin-left: 0;
    }
}

/* ==============================================
   Modal
   ============================================== */

.sa-announcement-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sa-announcement-modal.active {
    display: flex;
}

.sa-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease;
}

.sa-modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

.sa-modal-close {
    position: absolute !important;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    color: #212529;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sa-modal-close:focus {border:none !important;}

.sa-modal-close:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border:none !important;
}

.sa-modal-item {
    overflow-y: auto;
    max-height: 90vh;
}

.sa-modal-image {
    width: 100%;
    background: #f8f9fa;
}

.sa-modal-image img {
    width: 100%;
    height: auto;
    display: block;
}

.sa-modal-body {
    padding: 30px;
}

.sa-modal-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 700;
    color: #212529;
    line-height: 1.3;
}

.sa-modal-text {
    font-size: 16px;
    line-height: 1.6;
    color: #495057;
}

.sa-modal-text p:last-child {
    margin-bottom: 0;
}

.sa-modal-text a {
    color: #0d6efd;
    text-decoration: underline;
}

.sa-modal-text a:hover {
    color: #0a58ca;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sa-announcement-modal {
        padding: 0;
    }

    .sa-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .sa-modal-item {
        max-height: 100vh;
    }

    .sa-modal-body {
        padding: 25px 20px;
    }

    .sa-modal-title {
        font-size: 20px;
        padding-right: 30px;
    }

    .sa-modal-text {
        font-size: 15px;
    }
}

/* ==============================================
   Animations
   ============================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   Body Padding Adjustment
   ============================================== */

body.sa-has-announcement-bar {
    padding-top: 56px;
}

@media (max-width: 768px) {
    body.sa-has-announcement-bar {
        padding-top: 72px;
    }
}
