/**
 * Flash Cards Styles
 * 
 * Contains all CSS styling for the flashcards page including
 * flip card animations, responsive design, and theme colors.
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #4CAF50;
}

h1 {
    color: #4CAF50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.category-emoji {
    margin-bottom: 10px;
}

.category-emoji img {
    width: 140px;
    height: 140px;
    object-fit: contain;
}

.category-name {
    color: #2E7D32;
    font-size: 1.8em;
    margin-bottom: 5px;
}

.category-description {
    color: #666;
    font-size: 1.1em;
}

.page-info {
    text-align: center;
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

#flashcards-start {
    scroll-margin-top: 20px;
}

.shuffle-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    flex-wrap: wrap;
}

.shuffle-status {
    font-weight: 600;
    color: #4CAF50;
    font-size: 1em;
}

.shuffle-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: 2px solid #4CAF50;
}

.shuffle-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* Language Toggle Styles */
.language-toggle {
    position: absolute;
    top: 100px;
    right: 20px;
    z-index: 100;
}

.language-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    color: #2E7D32;
    border: 2px solid #4CAF50;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.language-toggle-btn:hover {
    background: #4CAF50;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.language-toggle-btn .lang-icon {
    font-size: 1.2em;
}

.language-toggle-btn .lang-text {
    font-weight: 600;
}

@media (max-width: 768px) {
    .language-toggle {
        position: static;
        display: flex;
        justify-content: center;
        margin: 10px 0 20px 0;
    }
    
    .language-toggle-btn {
        width: auto;
    }
}

.autoplay-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    padding: 8px 12px;
    margin-left: 15px;
    background: #f0f4f8;
    border-radius: 20px;
    transition: all 0.3s ease;
    user-select: none;
}

.autoplay-control:hover {
    background: #e2e8f0;
}

.autoplay-control input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin: 0;
}

.autoplay-control span {
    color: #2d3748;
}

/* Search Container Styles */
.search-container {
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-all-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.search-all-checkbox:hover {
    background: #f0f0f0;
}

.search-all-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin: 0;
}

.search-all-checkbox span {
    font-size: 0.95em;
    color: #333;
}

.search-input-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    font-size: 1em;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    text-decoration: none;
    font-size: 1.2em;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s ease;
    cursor: pointer;
}

.search-clear:hover {
    color: #e53e3e;
}

.search-button {
    padding: 12px 24px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.search-button:active {
    transform: translateY(0);
}

.search-results-info {
    margin-top: 12px;
    padding: 10px 16px;
    background: #e6f7ff;
    border-left: 4px solid #4CAF50;
    border-radius: 4px;
    color: #2c5282;
    font-size: 0.95em;
}

.search-results-info strong {
    color: #2E7D32;
    font-weight: 600;
}

/* Mobile responsiveness for search */
@media (max-width: 600px) {
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input-wrapper {
        min-width: 100%;
    }
    
    .search-button {
        width: 100%;
    }
}

.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.flashcard {
    perspective: 1000px;
    height: 400px;
    cursor: pointer;
    position: relative;
}

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

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

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.flashcard:hover .flashcard-front,
.flashcard:hover .flashcard-back {
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.flashcard-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

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

.flashcard-emoji {
    font-size: 6em;
    margin-bottom: 0;
    display: block;
}

.flip-instruction {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75em;
    color: #718096;
    opacity: 0.7;
    font-style: italic;
}

.flashcard-emoji-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    margin-bottom: 0;
    display: block;
}

.flashcard-number {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(76, 175, 80, 0.2);
    color: #2E7D32;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85em;
}

.flashcard-question {
    font-size: 1.3em;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 8px;
}

.flashcard-question-hint {
    font-size: 0.9em;
    color: #718096;
    margin-top: 8px;
    margin-bottom: 8px;
    font-style: italic;
    line-height: 1.4;
}

.flashcard-translation {
    font-size: 1em;
    color: #4a5568;
    margin-bottom: 15px;
    font-style: italic;
}

.flashcard-answer {
    background: #4CAF50;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.flashcard-answer-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.flashcard-answer-translation {
    font-size: 0.75em;
    font-weight: 400;
    opacity: 0.9;
    font-style: italic;
}

.audio-player {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.audio-player:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.audio-player::before {
    content: '🔊';
    font-size: 16px;
}

.flashcard-hint {
    background: #e6f3ff;
    border-left: 4px solid #3182ce;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #2c5282;
}

.flashcard-hint strong {
    color: #2b6cb0;
}

.flashcard-example {
    background: #f7fafc;
    border-left: 4px solid #48bb78;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #2f855a;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.flashcard-example-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.flashcard-example-translation {
    font-size: 0.85em;
    color: #38a169;
    opacity: 0.85;
}

.example-audio-player {
    background: rgba(72, 187, 120, 0.2);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.example-audio-player:hover {
    background: rgba(72, 187, 120, 0.3);
    transform: scale(1.1);
}

.example-audio-player::before {
    content: '🔊';
    font-size: 14px;
}

.flashcard-difficulty {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    margin-top: 10px;
}

.difficulty-easy {
    background: #c6f6d5;
    color: #22543d;
}

.difficulty-medium {
    background: #feebc8;
    color: #7c2d12;
}

.difficulty-hard {
    background: #fed7d7;
    color: #742a2a;
}

/* Flashcard watermark (hidden by default, shown only during image capture) */
.flashcard-watermark {
    display: none;
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.75em;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 10;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination-prev-next,
.pagination-position {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 16px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.pagination a:hover {
    background: #45a049;
}

.pagination .current-page {
    background: #2E7D32;
}

.pagination .disabled {
    background: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
}

.category-selector {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.category-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.category-selector h3 {
    color: #2d3748;
    margin-bottom: 15px;
    flex: 1;
}

.category-toggle-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-toggle-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

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

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.8em;
}

.category-selector.expanded .toggle-icon {
    transform: rotate(180deg);
}

.category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    color: #4CAF50;
    text-decoration: none;
    border-radius: 20px;
    border: 2px solid #4CAF50;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-links a:hover {
    background: #4CAF50;
    color: white;
}

.category-links a.active {
    background: #4CAF50;
    color: white;
}

.category-check {
    font-weight: bold;
    font-size: 1.1em;
    margin-right: -4px;
}

.category-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Download card button */
.download-card-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.flashcard.flipped .download-card-btn {
    display: flex;
}

.download-card-btn:hover {
    background: rgba(76, 175, 80, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

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

.download-card-btn svg {
    width: 20px;
    height: 20px;
}

.download-text {
    display: inline;
}

@media (max-width: 768px) {
    .download-card-btn {
        padding: 10px;
        border-radius: 50%;
        bottom: 10px;
        right: 10px;
    }
    
    .download-text {
        display: none;
    }
    
    .download-card-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Mobile optimization for category selector */
@media (max-width: 768px) {
    .category-selector-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .category-toggle-btn {
        display: flex;
        width: 100%;
        justify-content: center;
    }
    
    .category-selector h3 {
        margin-bottom: 0;
        text-align: center;
    }
    
    .category-links {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
        margin-top: 0;
    }
    
    .category-links a {
        width: 100%;
        justify-content: flex-start;
    }
    
    .category-selector.expanded .category-links {
        max-height: 2000px;
        opacity: 1;
        margin-top: 15px;
    }
}

.links-container {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.feedback-link {
    flex: 1;
    min-width: 300px;
    text-align: center;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.feedback-link a {
    display: inline-block;
    padding: 10px 24px;
    background: #2196F3;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
}

.feedback-link a:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.about-link {
    flex: 1;
    min-width: 300px;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.about-link a {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
}

.about-link a:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.back-to-app {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

/* Social Sharing */
.social-sharing {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f7fafc 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    text-align: center;
}

.social-sharing h3 {
    color: #4CAF50;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.social-sharing p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.social-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

.social-btn.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0d65d9 100%);
}

.social-btn.twitter {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}

.social-btn.linkedin {
    background: linear-gradient(135deg, #0077b5 0%, #005582 100%);
}

.social-btn.whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #1da851 100%);
}

.social-btn.email {
    background: linear-gradient(135deg, #ea4335 0%, #c5221f 100%);
}

.back-to-app {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.back-to-app a {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1em;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.back-to-app a:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.no-questions {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-questions h2 {
    color: #4CAF50;
    margin-bottom: 10px;
}

.no-questions a {
    color: #4CAF50;
    text-decoration: underline;
    font-weight: 600;
}

.no-questions a:hover {
    color: #2E7D32;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .category-name {
        font-size: 1.4em;
    }
    
    .flashcards-grid {
        grid-template-columns: 1fr;
    }
    
    .walker-avatar {
        display: none;
    }
    
    .flashcards-logo {
        max-width: 90% !important;
        width: 90% !important;
    }
    
    .links-container {
        flex-direction: column;
    }
    
    .feedback-link,
    .about-link {
        min-width: 100%;
        padding: 15px;
    }
    
    .feedback-link a,
    .about-link a {
        font-size: 0.9em;
        padding: 10px 15px;
        display: block;
        word-wrap: break-word;
    }
    
    /* Pagination mobile layout */
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-prev-next {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .pagination-position {
        order: 2;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}
