/**
 * ABC Learning Portal - Frontend CSS
 * 
 * Frontend styling for games and learning portal
 * 
 * @package ABC_Learning_Portal
 * @since 1.0.0
 */

/* General Styles */
.abc-learning-portal,
.abc-alphabet-game,
.abc-math-game {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Button Styles */
.abc-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.abc-btn-primary {
    background: #28a745;
    color: white;
}

.abc-btn-primary:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

.abc-btn-secondary {
    background: #6c757d;
    color: white;
}

.abc-btn-secondary:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

/* Game containers */
.abc-game {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    max-width: 800px;
    margin: 20px auto;
}

/* Learning portal */
.abc-portal {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Game Styles */
.abc-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.abc-game-header h3 {
    margin: 0;
    color: #2c3e50;
}

.abc-game-controls {
    display: flex;
    gap: 10px;
}

.abc-game-area {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.abc-game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.abc-stat {
    text-align: center;
}

.abc-stat-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.abc-stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #28a745;
}

/* Alphabet Game Specific */
.abc-current-letter {
    text-align: center;
    margin-bottom: 30px;
}

.abc-letter-display {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
}

.abc-letter {
    font-size: 72px;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.abc-letter-name {
    font-size: 24px;
    opacity: 0.9;
}

.abc-letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.abc-letter-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid transparent;
}

.abc-letter-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: #28a745;
}

.abc-letter-card.selected {
    background: #28a745;
    color: white;
    transform: scale(1.05);
}

.abc-letter-card.correct {
    background: #d4edda;
    border-color: #28a745;
    animation: correctPulse 0.6s ease;
}

.abc-letter-card.wrong {
    background: #f8d7da;
    border-color: #dc3545;
    animation: wrongShake 0.6s ease;
}

.abc-letter-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 8px;
}

.abc-letter-text {
    font-size: 18px;
    font-weight: bold;
}

/* Math Game Specific */
.abc-math-problem {
    text-align: center;
    margin: 30px 0;
}

.abc-problem-display {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.abc-problem-text {
    font-size: 48px;
    font-weight: bold;
    color: #2c3e50;
}

.abc-equals {
    font-size: 48px;
    font-weight: bold;
    color: #28a745;
}

.abc-answer-input {
    font-size: 48px;
    font-weight: bold;
    width: 120px;
    text-align: center;
    border: 3px solid #dee2e6;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
}

.abc-answer-input:focus {
    border-color: #28a745;
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.abc-feedback {
    margin: 20px 0;
    text-align: center;
}

.abc-feedback-content {
    padding: 20px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 20px;
    animation: feedbackSlide 0.5s ease;
}

.abc-feedback.correct .abc-feedback-content {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.abc-feedback.wrong .abc-feedback-content {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* Learning Portal Styles */
.abc-portal-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.abc-portal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s infinite linear;
}

.abc-portal-header h2 {
    margin: 0 0 20px 0;
    font-size: 36px;
    position: relative;
    z-index: 1;
}

.abc-language-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.abc-lang-btn {
    padding: 10px 25px;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.abc-lang-btn.active,
.abc-lang-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

.abc-portal-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.abc-tab-btn {
    flex: 1;
    padding: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    color: #6c757d;
}

.abc-tab-btn.active {
    background: white;
    color: #28a745;
    border-bottom: 4px solid #28a745;
    transform: translateY(-2px);
}

.abc-tab-btn:hover:not(.active) {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.abc-portal-content {
    padding: 40px;
    min-height: 400px;
}

.abc-tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.abc-tab-content.active {
    display: block;
}

/* Grid Layouts */
.abc-alphabet-grid,
.abc-numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.abc-operations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.abc-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

/* Item Cards */
.abc-letter-item,
.abc-number-item,
.abc-operation-item {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 2px solid transparent;
}

.abc-letter-item:hover,
.abc-number-item:hover,
.abc-operation-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #28a745;
}

.abc-letter-icon img,
.abc-number-icon img,
.abc-operation-icon img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.abc-letter-item:hover .abc-letter-icon img,
.abc-number-item:hover .abc-number-icon img,
.abc-operation-item:hover .abc-operation-icon img {
    transform: scale(1.1);
}

.abc-letter-char,
.abc-number-value,
.abc-operation-symbol {
    font-size: 28px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 8px;
}

.abc-letter-name,
.abc-number-name,
.abc-operation-name {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* Game Cards */
.abc-game-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.abc-game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-color: #28a745;
}

.abc-game-card h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 20px;
}

.abc-game-card p {
    margin: 0 0 20px 0;
    color: #6c757d;
    line-height: 1.6;
}

.abc-play-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.abc-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Letter and Number Displays */
.abc-letter-display,
.abc-number-display {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 10px 0;
}

.abc-letter-icon img,
.abc-number-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.abc-letter-char,
.abc-number-value {
    font-size: 48px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 10px;
}

.abc-letter-name,
.abc-number-name {
    font-size: 18px;
    color: #6c757d;
}

/* Animations */
@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes feedbackSlide {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes float {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(100px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .abc-portal-header h2 {
        font-size: 28px;
    }
    
    .abc-portal-content {
        padding: 20px;
    }
    
    .abc-alphabet-grid,
    .abc-numbers-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .abc-games-grid {
        grid-template-columns: 1fr;
    }
    
    .abc-problem-display {
        flex-direction: column;
        gap: 15px;
    }
    
    .abc-problem-text,
    .abc-equals,
    .abc-answer-input {
        font-size: 36px;
    }
    
    .abc-letter {
        font-size: 48px;
    }
    
    .abc-letter-name {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .abc-portal-header {
        padding: 20px;
    }
    
    .abc-portal-header h2 {
        font-size: 24px;
    }
    
    .abc-language-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .abc-portal-tabs {
        flex-direction: column;
    }
    
    .abc-tab-btn {
        padding: 15px;
    }
    
    .abc-alphabet-grid,
    .abc-numbers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .abc-operations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

