/**
 * Tamil Vocabulary Gallery - Stylesheet
 * Version: 1.0.0
 * Description: Styles for interactive Tamil vocabulary picture gallery
 */

/* ==========================================
   MAIN WRAPPER
   ========================================== */
.tamil-vocabulary-gallery-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Error Message */
.tvg-error {
    background: #fee;
    border: 2px solid #f88;
    border-radius: 10px;
    padding: 15px;
    color: #c33;
    font-weight: 600;
}

/* ==========================================
   INSTRUCTIONS ACCORDION SECTION
   ========================================== */
.tvg-instructions-container {
    max-width: 900px;
    margin: 20px auto 40px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 20px;
}

.tvg-instruction-accordion {
    margin-bottom: 15px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.tvg-instruction-accordion:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tvg-accordion-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.tvg-instruction-accordion[data-lang="tamil"] .tvg-accordion-header {
    background: linear-gradient(135deg, #FF6B9D 0%, #FF8E53 100%);
}

.tvg-accordion-header:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.tvg-accordion-icon {
    font-size: 28px;
    font-weight: bold;
    color: white;
    margin-right: 15px;
    transition: transform 0.3s ease;
    min-width: 30px;
    text-align: center;
}

.tvg-accordion-header.active .tvg-accordion-icon {
    transform: rotate(45deg);
}

.tvg-accordion-title {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    flex-grow: 1;
}

.tvg-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: #F7F9FC;
}

.tvg-accordion-content.active {
    max-height: 800px;
    padding: 25px;
}

.tvg-instruction-text {
    color: #2D3748;
    line-height: 1.8;
    font-size: 17px;
}

.tvg-instruction-text p {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

.tvg-instruction-text strong {
    color: #667eea;
    font-size: 18px;
}

.tvg-instruction-text ol {
    padding-left: 25px;
    margin: 15px 0;
}

.tvg-instruction-text li {
    margin-bottom: 15px;
    font-size: 16px;
    color: #4A5568;
}

/* ==========================================
   GALLERY AREA
   ========================================== */
.tvg-gallery-area {
    background: linear-gradient(135deg, #F0F4FF 0%, #E8F0FF 100%);
    border-radius: 30px;
    padding: 40px 20px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tvg-gallery-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.tvg-gallery-slides {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.tvg-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    padding: 20px;
}

.tvg-slide.active {
    display: block;
    opacity: 1;
    animation: tvgSlideIn 0.5s ease;
}

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

/* ==========================================
   IMAGE CARD
   ========================================== */
.tvg-image-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 600px;
    margin: 0 auto;
    border: 5px solid #e0e0e0;
}

.tvg-image-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 70px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.tvg-image-card:active {
    transform: scale(0.98);
}

.tvg-image-wrapper {
    position: relative;
    width: 100%;
    background: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    border: 3px solid #e0e0e0;
}

.tvg-vocab-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 20px;
}

/* Play Indicator */
.tvg-play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102, 126, 234, 0.9);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.tvg-image-card:hover .tvg-play-indicator {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.tvg-play-icon {
    width: 35px;
    height: 35px;
    margin-left: 5px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Sound Waves */
.tvg-sound-waves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    pointer-events: none;
}

.tvg-sound-waves.playing {
    display: block;
}

.tvg-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 4px solid #FF6B9D;
    border-radius: 15px;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.tvg-wave:nth-child(1) {
    animation: tvgWaveAnimation 1.5s ease-out infinite;
}

.tvg-wave:nth-child(2) {
    animation: tvgWaveAnimation 1.5s ease-out 0.3s infinite;
}

.tvg-wave:nth-child(3) {
    animation: tvgWaveAnimation 1.5s ease-out 0.6s infinite;
}

@keyframes tvgWaveAnimation {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

/* ==========================================
   WORD DISPLAY
   ========================================== */
.tvg-word-display {
    text-align: center;
    padding-top: 10px;
}

.tvg-tamil-word {
    font-size: 48px;
    font-weight: 900;
    color: #2D3748;
    margin-bottom: 10px;
    line-height: 1.2;
}

.tvg-highlight {
    color: #FF1744;
    position: relative;
    display: inline-block;
}

.tvg-english-word {
    font-size: 28px;
    font-weight: 600;
    color: #4A5568;
    letter-spacing: 1px;
}

/* ==========================================
   NAVIGATION ARROWS
   ========================================== */
.tvg-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(102, 126, 234, 0.95);
    border: 3px solid white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 10;
    color: white;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
}

.tvg-nav-arrow svg {
    width: 35px;
    height: 35px;
    stroke: white;
    stroke-width: 4;
    fill: none;
}

/* Add CSS arrow as fallback */
.tvg-nav-prev::before {
    content: "‹";
    font-size: 48px;
    color: white;
    font-weight: bold;
    position: absolute;
}

.tvg-nav-next::before {
    content: "›";
    font-size: 48px;
    color: white;
    font-weight: bold;
    position: absolute;
}

.tvg-nav-arrow:hover {
    background: rgba(255, 107, 157, 0.95);
    border-color: white;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 25px rgba(255, 107, 157, 0.5);
}

.tvg-nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.tvg-nav-prev {
    left: 15px;
}

.tvg-nav-next {
    right: 15px;
}

/* ==========================================
   PAGINATION DOTS
   ========================================== */
.tvg-pagination-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.tvg-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #CBD5E0;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.tvg-dot:hover {
    background: #94A3B8;
    transform: scale(1.2);
}

.tvg-dot.active {
    background: #1A202C;
    width: 36px;
    border-radius: 7px;
}

/* Hide Audio Elements */
.tvg-audio-element {
    display: none;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
.tvg-image-card.playing {
    animation: tvgCardPulse 0.5s ease;
}

@keyframes tvgCardPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
    .tamil-vocabulary-gallery-wrapper {
        padding: 15px;
    }
    
    .tvg-accordion-title {
        font-size: 20px;
    }
    
    .tvg-gallery-area {
        padding: 30px 15px;
        min-height: 500px;
    }
    
    .tvg-image-card {
        padding: 20px;
    }
    
    .tvg-tamil-word {
        font-size: 36px;
    }
    
    .tvg-english-word {
        font-size: 22px;
    }
    
    .tvg-nav-arrow {
        width: 50px;
        height: 50px;
    }
    
    .tvg-nav-prev {
        left: 10px;
    }
    
    .tvg-nav-next {
        right: 10px;
    }
    
    .tvg-play-indicator {
        width: 70px;
        height: 70px;
    }
    
    .tvg-instruction-text li {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .tvg-gallery-area {
        padding: 20px 10px;
    }
    
    .tvg-slide {
        padding: 10px;
    }
    
    .tvg-image-card {
        padding: 15px;
        border-width: 3px;
    }
    
    .tvg-tamil-word {
        font-size: 32px;
    }
    
    .tvg-english-word {
        font-size: 20px;
    }
    
    .tvg-nav-arrow {
        width: 45px;
        height: 45px;
    }
    
    .tvg-nav-prev {
        left: 5px;
    }
    
    .tvg-nav-next {
        right: 5px;
    }
    
    .tvg-accordion-header {
        padding: 15px 20px;
    }
    
    .tvg-accordion-title {
        font-size: 18px;
    }
    
    .tvg-dot {
        width: 12px;
        height: 12px;
    }
    
    .tvg-dot.active {
        width: 30px;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */
.tvg-image-card:focus {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

.tvg-nav-arrow:focus {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

.tvg-dot:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Screen reader only text */
.tvg-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================
   TOUCH DEVICE OPTIMIZATIONS
   ========================================== */
@media (hover: none) and (pointer: coarse) {
    .tvg-image-card:hover {
        transform: none;
    }
    
    .tvg-play-indicator {
        opacity: 0.7;
    }
    
    .tvg-nav-arrow {
        opacity: 0.9;
    }
}
