/* WhatsApp Status-like Service Content Viewer */

:root {
    --status-dot-size: 3px;
    --status-dot-gap: 4px;
    --status-duration: 5s;
}

/* Status Viewer Overlay */
.status-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none !important;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.status-viewer-overlay.active {
    display: flex !important;
}

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

/* Status Viewer Container */
.status-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100vw;
    max-height: 100vh;
    background: #000;
    overflow: hidden;
}

/* Status Progress Bar */
.status-progress-bar {
    display: flex;
    gap: var(--status-dot-gap);
    padding: 12px 8px;
    background: rgba(0, 0, 0, 0.3);
    justify-content: center;
    width: 100%;
    position: relative;
    z-index: 2010;
}

.status-dot {
    flex: 1;
    height: var(--status-dot-size);
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}

.status-dot.active::before {
    content: '';
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 1);
    border-radius: 2px;
    animation: progress var(--status-duration) linear forwards;
}

.status-dot.viewed {
    background: rgba(255, 255, 255, 0.8);
}

.status-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

@keyframes progress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* Status Header */
.status-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 16px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 2015;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
}

.status-service-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-service-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.status-service-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-service-alias {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.status-service-name {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.status-close-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.2s;
}

.status-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Status Content Area */
.status-content-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 300px;
}

.status-item {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: slideInStatus 0.4s ease-out forwards;
}

.status-item.previous {
    animation: slideOutStatus 0.4s ease-out forwards;
}

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

@keyframes slideOutStatus {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* Status Image */
.status-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0;
}

/* Status Video */
.status-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Status Text Overlay */
.status-text-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
    color: white;
}

.status-text-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-text-description {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

/* Navigation Arrows */
.status-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2020;
    transition: background 0.2s ease;
    font-size: 20px;
    border-radius: 4px;
}

.status-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.25);
}

.status-nav-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.status-nav-prev {
    left: 12px;
}

.status-nav-next {
    right: 12px;
}

/* Mobile Tap Areas */
.status-tap-area {
    position: absolute;
    top: 50%;
    width: 50%;
    height: 100%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 2005;
}

.status-tap-prev {
    left: 0;
}

.status-tap-next {
    right: 0;
}

/* Counter Display */
.status-counter {
    position: absolute;
    bottom: 20px;
    right: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2010;
}

/* Responsive Design */
@media (max-width: 480px) {
    .status-viewer-overlay {
        display: none !important;
    }

    .status-viewer-overlay.active {
        display: flex !important;
        width: 100vw !important;
        height: 100vh !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    .status-viewer-container {
        max-width: 100vw;
        max-height: 100vh;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        overflow: hidden;
    }

    .status-progress-bar {
        padding: 8px 4px;
        gap: 2px;
        flex-shrink: 0;
    }

    .status-dot {
        height: 2px;
    }

    .status-header {
        padding: 12px 12px 0 12px;
        z-index: 2015;
        flex-shrink: 0;
    }

    .status-content-area {
        flex: 1;
        width: 100%;
        height: auto;
        min-height: auto;
        overflow: hidden;
    }

    .status-item {
        width: 100vw;
        height: 100%;
    }

    .status-text-overlay {
        padding: 16px 12px;
    }

    .status-nav-arrow {
        display: none !important;
    }

    .status-counter {
        bottom: 16px;
        right: 12px;
        font-size: 11px;
    }
}

@media (min-width: 768px) {
    .status-viewer-container {
        max-width: 480px;
        max-height: 90vh;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }

    .status-item {
        border-radius: 16px 16px 0 0;
    }

    .status-nav-arrow {
        display: flex;
    }
}

/* Animations for Service Content */
@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.status-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.status-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* No Content State */
.status-no-content {
    color: white;
    text-align: center;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-no-content-icon {
    font-size: 48px;
    opacity: 0.5;
}

/* Touch & Drag Support */
.status-viewer-container.dragging {
    cursor: grabbing;
}

/* Keyboard Navigation Hint */
.status-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    display: none;
    z-index: 2010;
    pointer-events: none;
}

@media (min-width: 768px) {
    .status-hint {
        display: block;
    }
}

/* Print Styles */
@media print {
    .status-viewer-overlay {
        display: none !important;
    }
}
