/**
 * AWC Demo Vault - Frontend Styles
 * Uses same variables as Production Process for visual consistency
 */

:root {
    --awcpp-primary: #00d937;
    --awcpp-primary-glow: rgba(0, 255, 65, 0.3);
    --awcpp-bg-dark: #0a0a0a;
    --awcpp-bg-card: #141414;
    --awcpp-bg-elevated: #1a1a1a;
    --awcpp-border: #2a2a2a;
    --awcpp-text: #ffffff;
    --awcpp-text-muted: #888888;
    --awcpp-accent: #ff6b00;
    --awcpp-danger: #ff4444;
}

/* Demo Vault Container */
.awc-demo-vault {
    max-width: var(--aw-content-width, 1300px);
    margin: 0 auto;
    padding: 40px 20px;
    color: var(--awcpp-text);
}

/* Header */
.awc-demo-vault__header {
    text-align: center;
    margin-bottom: 40px;
}

.awc-demo-vault__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--awcpp-text);
}

.awc-demo-vault__subtitle {
    font-size: 1.1rem;
    color: var(--awcpp-text-muted);
    margin: 0;
}

/* Login Notice */
.awc-demo-vault__login-notice {
    background: linear-gradient(135deg, rgba(0, 217, 55, 0.1), rgba(0, 217, 55, 0.05));
    border: 1px solid var(--awcpp-primary);
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    margin-bottom: 30px;
}

.awc-demo-vault__login-notice p {
    margin: 0;
    color: var(--awcpp-text-muted);
}

.awc-demo-vault__login-notice a {
    color: var(--awcpp-primary);
    font-weight: 600;
}

.awc-demo-vault__login-notice a:hover {
    text-decoration: underline;
}

/* Grid Layout */
.awc-demo-vault__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* Demo Card - Flip Container */
.awc-demo-card {
    perspective: 2000px;
}

.awc-demo-card__inner {
    position: relative;
    width: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.awc-demo-card--flipped .awc-demo-card__inner {
    transform: rotateY(180deg);
}

.awc-demo-card__front {
    position: relative;
    width: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--awcpp-bg-card);
    border: 1px solid var(--awcpp-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.awc-demo-card__back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--awcpp-bg-card);
    border: 1px solid var(--awcpp-border);
    border-radius: 12px;
    overflow: hidden;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
}

.awc-demo-card:not(.awc-demo-card--flipped):hover .awc-demo-card__front {
    border-color: var(--awcpp-primary);
}

/* Thumbnail */
.awc-demo-card__thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.awc-demo-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.awc-demo-card:hover .awc-demo-card__thumbnail img {
    transform: scale(1.05);
}

/* Content */
.awc-demo-card__content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.awc-demo-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.awc-demo-card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--awcpp-text);
}

/* Lyrics Button */
.awc-demo-card__lyrics-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--awcpp-border);
    border-radius: 20px;
    color: var(--awcpp-text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.awc-demo-card__lyrics-btn:hover {
    border-color: var(--awcpp-primary);
    color: var(--awcpp-primary);
}

.awc-demo-card__lyrics-btn svg {
    width: 16px;
    height: 16px;
}

/* Card Back - Lyrics */
.awc-demo-card__back-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--awcpp-border);
    background: var(--awcpp-bg-elevated);
}

.awc-demo-card__back-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: var(--awcpp-text);
}

.awc-demo-card__close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--awcpp-border);
    border-radius: 50%;
    color: var(--awcpp-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.awc-demo-card__close-btn:hover {
    border-color: var(--awcpp-primary);
    color: var(--awcpp-primary);
}

.awc-demo-card__lyrics {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.4;
    color: var(--awcpp-text-muted);
    white-space: pre-wrap;
}

.awc-demo-card__lyrics::-webkit-scrollbar {
    width: 6px;
}

.awc-demo-card__lyrics::-webkit-scrollbar-track {
    background: var(--awcpp-bg-elevated);
}

.awc-demo-card__lyrics::-webkit-scrollbar-thumb {
    background: var(--awcpp-border);
    border-radius: 3px;
}

.awc-demo-card__lyrics::-webkit-scrollbar-thumb:hover {
    background: var(--awcpp-text-muted);
}

.awc-demo-card__description {
    font-size: 0.9rem;
    color: var(--awcpp-text-muted);
    margin: 0 0 15px;
    line-height: 1.5;
}

/* Audio Player - Custom styled player matching Production Process */
.awc-demo-card__audio {
    margin-bottom: 15px;
}

.awc-demo-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--awcpp-bg-elevated);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--awcpp-border);
}

.awc-demo-audio-player__play {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--awcpp-primary);
    border: none;
    border-radius: 50%;
    color: var(--awcpp-bg-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.awc-demo-audio-player__play:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--awcpp-primary-glow);
}

.awc-demo-audio-player__play svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.awc-demo-audio-player__play--playing svg {
    /* Pause icon positioning */
}

.awc-demo-audio-player__waveform {
    flex: 1;
    height: 24px;
    background: var(--awcpp-border);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.awc-demo-audio-player__progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--awcpp-primary), var(--awcpp-accent));
    border-radius: 4px;
    transition: width 0.1s linear;
}

.awc-demo-audio-player__time {
    font-size: 12px;
    color: var(--awcpp-text-muted);
    font-family: monospace;
    min-width: 40px;
    text-align: right;
}

.awc-demo-audio-player__restart {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: var(--awcpp-text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.awc-demo-audio-player__restart:hover {
    color: var(--awcpp-primary, #00d937);
    border-color: var(--awcpp-primary, #00d937);
}

.awc-demo-audio-player audio {
    display: none;
}

/* Video Player */
.awc-demo-card__video {
    margin-bottom: 15px;
}

.awc-demo-card__video video {
    width: 100%;
    border-radius: 8px;
}

/* Voting Section */
.awc-demo-card__voting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--awcpp-border);
}

/* Progress Bar */
.awc-demo-card__progress {
    flex: 1;
}

.awc-demo-card__progress-bar {
    height: 8px;
    background: var(--awcpp-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.awc-demo-card__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--awcpp-primary), var(--awcpp-accent));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.awc-demo-card__progress-fill--complete {
    background: linear-gradient(90deg, #ffd700, var(--awcpp-accent));
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }
}

.awc-demo-card__vote-count {
    font-size: 0.8rem;
    color: var(--awcpp-text-muted);
}

.awc-demo-card__vote-count strong {
    color: var(--awcpp-primary);
    font-weight: 700;
}

/* Vote Button */
.awc-demo-card__vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: transparent;
    border: 2px solid var(--awcpp-primary);
    border-radius: 25px;
    color: var(--awcpp-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.awc-demo-card__vote-btn:hover {
    background: var(--awcpp-primary);
    color: var(--awcpp-bg-dark);
    box-shadow: 0 0 20px var(--awcpp-primary-glow);
}

.awc-demo-card__vote-btn--voted {
    background: var(--awcpp-primary);
    color: var(--awcpp-bg-dark);
}

.awc-demo-card__vote-btn--voted:hover {
    background: transparent;
    color: var(--awcpp-primary);
}

.awc-demo-card__vote-btn--login {
    border-color: var(--awcpp-border);
    color: var(--awcpp-text-muted);
}

.awc-demo-card__vote-btn--login:hover {
    border-color: var(--awcpp-primary);
    color: var(--awcpp-primary);
    background: transparent;
}

.awc-demo-card__vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.awc-demo-card__vote-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.awc-demo-card__vote-icon svg {
    width: 18px;
    height: 18px;
}

/* Loading State */
.awc-demo-card__vote-btn.loading {
    pointer-events: none;
}

.awc-demo-card__vote-btn.loading .awc-demo-card__vote-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Empty State */
.awc-demo-vault__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--awcpp-bg-card);
    border: 1px dashed var(--awcpp-border);
    border-radius: 12px;
    color: var(--awcpp-text-muted);
}

/* Pagination */
.awc-demo-vault__pagination {
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.awc-demo-vault__pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--awcpp-bg-card);
    border: 1px solid var(--awcpp-border);
    border-radius: 8px;
    color: var(--awcpp-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.awc-demo-vault__pagination-btn:hover:not(:disabled) {
    border-color: var(--awcpp-primary);
    color: var(--awcpp-primary);
}

.awc-demo-vault__pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.awc-demo-vault__pagination-btn svg {
    width: 20px;
    height: 20px;
}

.awc-demo-vault__pagination-info {
    color: var(--awcpp-text-muted);
    font-size: 14px;
}

/* Grid Animation Container */
.awc-demo-vault__grid-wrapper {
    position: relative;
}

.awc-demo-vault__grid-wrapper--animating {
    overflow: hidden;
}

.awc-demo-vault__grid {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.awc-demo-vault__grid--loading {
    pointer-events: none;
}

/* Slide out to the left (going forward) */
.awc-demo-vault__grid--slide-out-left {
    transform: translateX(-100%);
    opacity: 0;
}

/* Slide out to the right (going backward) */
.awc-demo-vault__grid--slide-out-right {
    transform: translateX(100%);
    opacity: 0;
}

/* Slide in from right (going forward) */
.awc-demo-vault__grid--slide-in-right {
    transform: translateX(100%);
    opacity: 0;
    transition: none;
}

/* Slide in from left (going backward) */
.awc-demo-vault__grid--slide-in-left {
    transform: translateX(-100%);
    opacity: 0;
    transition: none;
}

/* Final position */
.awc-demo-vault__grid--slide-in {
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .awc-demo-vault {
        padding: 20px 15px;
    }

    .awc-demo-vault__title {
        font-size: 1.75rem;
    }

    .awc-demo-vault__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .awc-demo-card__header {
        flex-wrap: wrap;
    }

    .awc-demo-card__voting {
        flex-direction: column;
        align-items: stretch;
    }

    .awc-demo-card__vote-btn {
        justify-content: center;
    }

    .awc-demo-vault__pagination {
        flex-wrap: wrap;
        gap: 10px;
    }

    .awc-demo-vault__pagination-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .awc-demo-vault__pagination-btn span {
        display: none;
    }
}

