/* Cebuano Flashcards Styles - Mobile-First Design */

#cebuano-flashcards-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Loading Spinner */
.cebuano-loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Error Messages */
.cebuano-error,
.cebuano-error-message {
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 20px;
    color: #c33;
    text-align: center;
}

/* Controls Section */
.cebuano-controls {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.control-group {
    margin-bottom: 15px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.control-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.control-group select:focus {
    outline: none;
    border-color: #3498db;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Stats Counter */
.cebuano-stats {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #666;
    margin-bottom: 20px;
    padding: 10px;
}

#current-card-num {
    color: #3498db;
    font-size: 24px;
}

/* Flashcard Container */
.flashcard-wrapper {
    perspective: 1000px;
    margin-bottom: 30px;
}

.flashcard {
    width: 100%;
    min-height: 400px;
    position: relative;
    cursor: pointer;
    margin-bottom: 20px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    min-height: 400px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

/* Disable transition when navigating cards to prevent flash */
.flashcard.no-transition .flashcard-inner {
    transition: none;
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    min-height: 400px;
    backface-visibility: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    box-sizing: border-box;
}

.flashcard-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.flashcard-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}

.card-content {
    width: 100%;
    text-align: center;
    font-size: 28px;
    line-height: 1.4;
    word-wrap: break-word;
}

.card-word {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.card-pronunciation {
    font-size: 22px;
    font-style: italic;
    opacity: 0.9;
    margin: 15px 0;
}

.card-category {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 20px;
    font-weight: 600;
}

.card-definition {
    font-size: 24px;
    line-height: 1.5;
}

.card-sample {
    font-size: 16px;
    margin-top: 20px;
    opacity: 0.9;
    line-height: 1.6;
    font-style: italic;
    max-height: 150px;
    overflow-y: auto;
}

/* Pronunciation choice buttons */
.pronunciation-choices {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    width: 100%;
}

.pronunciation-btn {
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.pronunciation-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateX(5px);
}

.pronunciation-btn:active {
    transform: scale(0.98);
}

/* Tap Hint */
.tap-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    opacity: 0.7;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Navigation Buttons */
.flashcard-navigation {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.nav-btn {
    flex: 1;
    max-width: 200px;
    padding: 16px 24px;
    background: white;
    border: 2px solid #3498db;
    border-radius: 10px;
    color: #3498db;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover:not(:disabled) {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* Tablet Styles */
@media (min-width: 768px) {
    #cebuano-flashcards-container {
        max-width: 700px;
        padding: 30px;
    }

    .cebuano-controls {
        padding: 25px;
    }

    .control-group {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .control-group label {
        flex-shrink: 0;
        width: 150px;
        margin-bottom: 0;
    }

    .control-group select,
    .btn-primary {
        width: auto;
        flex: 1;
    }

    .flashcard {
        min-height: 450px;
    }

    .flashcard-front,
    .flashcard-back {
        min-height: 450px;
        padding: 50px 40px;
    }

    .card-content {
        font-size: 32px;
    }

    .card-word {
        font-size: 42px;
    }

    .pronunciation-choices {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .pronunciation-btn {
        flex: 1;
        min-width: 200px;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    #cebuano-flashcards-container {
        max-width: 900px;
    }

    .flashcard {
        min-height: 500px;
    }

    .flashcard-front,
    .flashcard-back {
        min-height: 500px;
    }

    .card-word {
        font-size: 48px;
    }

    .card-content {
        font-size: 36px;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
    .flashcard {
        -webkit-tap-highlight-color: transparent;
    }

    .nav-btn,
    .btn-primary,
    .pronunciation-btn {
        min-height: 48px; /* Ensures touch-friendly size */
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .cebuano-controls {
        background: #2d3748;
    }

    .control-group label {
        color: #e2e8f0;
    }

    .control-group select {
        background-color: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .cebuano-stats {
        color: #a0aec0;
    }
}

/* Accessibility improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles for keyboard navigation */
button:focus,
select:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

.flashcard:focus {
    outline: 3px solid #3498db;
    outline-offset: 4px;
}
