/* English Language Learning Plugin - Frontend Styles */

/* Container and Layout */
.gll-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
}

/* Cards */
.gll-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: black;
    margin-bottom: 30px;
    border: 1px solid #e1e5e9;
}

.gll-card h1, .gll-card h2, .gll-card h3 {
    margin-top: 0;
    color: #2c3e50;
}

/* Buttons */
.gll-button {
    background: #0073aa;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.4;
}

.gll-button:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.gll-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

.gll-button.secondary {
    background: #666;
}

.gll-button.secondary:hover {
    background: #444;
}

.gll-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

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

/* Level Filter */
.gll-level-filter {
    margin: 20px 0;
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #e1e5e9;
}

.gll-level-filter button,
.gll-level-btn {
    margin: 0 5px 10px 5px;
    padding: 10px 20px;
    border: 2px solid #0073aa;
    background: transparent;
    color: #0073aa;
    cursor: pointer;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.gll-level-filter button.active,
.gll-level-filter button:hover,
.gll-level-btn.active,
.gll-level-btn:hover {
    background: #0073aa;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* Level Badge */
.gll-level-badge {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Subscription Notice */
.gll-subscription-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gll-subscription-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.gll-subscription-notice p {
    margin: 10px 0;
    font-weight: 500;
}

.gll-subscription-info {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

/* Quiz Container */
.gll-quiz-container {
    text-align: center;
    padding: 40px 20px;
    min-height: 400px;
}

.gll-word-display {
    font-size: 42px;
    font-weight: bold;
    color: #0073aa;
    margin: 30px 0;
    text-shadow: 0 2px 4px rgba(0, 115, 170, 0.1);
}

.gll-pronunciation {
    font-style: italic;
    color: #666;
    margin-bottom: 30px;
    font-size: 18px;
}

.gll-quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.gll-quiz-option {
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.gll-quiz-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.gll-quiz-option:hover::before {
    left: 100%;
}

.gll-quiz-option:hover {
    border-color: #0073aa;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.15);
}

.gll-quiz-option.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.gll-quiz-option.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.gll-quiz-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.gll-quiz-result {
    margin: 30px 0;
    padding: 20px;
    border-radius: 8px;
    background: #f8f9fa;
}

.gll-quiz-actions {
    margin: 30px 0;
}

/* Flip Card for Words */
.gll-flip-card {
    background-color: transparent;
    width: 100%;
    max-width: 700px;
    height: 320px;
    perspective: 1000px;
    margin: 0 auto 20px auto;
}

.gll-flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.gll-flip-card.flipped .gll-flip-card-inner {
    transform: rotateY(180deg);
}

.gll-flip-card-front, .gll-flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
	min-height: fit-content;
}

.gll-flip-card-front {
    background-color: #ffffff;
}

.gll-flip-card-back {
    background-color: #f8f9fa;
    transform: rotateY(180deg);
	height: fit-content;
}

.gll-meaning, .gll-example {
    margin: 10px 0;
    font-size: 18px;
}

.gll-knowledge-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Progress Bar */
.gll-progress-bar {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin: 20px 0;
    position: relative;
}

.gll-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005a87);
    transition: width 0.5s ease;
    border-radius: 6px;
    position: relative;
}

.gll-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 35%, rgba(255, 255, 255, 0.3) 50%, transparent 65%);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Article Cards */
.gll-article-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.gll-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gll-article-image {
    margin: -30px -30px 20px -30px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.gll-article-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gll-article-card:hover .gll-article-image img {
    transform: scale(1.05);
}

.gll-article-content h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 20px;
}

.gll-article-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Subscription Page Styles */
.gll-pricing-card {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.gll-pricing-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pricing-glow 4s ease-in-out infinite alternate;
}

@keyframes pricing-glow {
    0% { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-50%, -50%) scale(1.1); }
}

.gll-price {
    font-size: 48px;
    font-weight: bold;
    margin: 30px 0;
    position: relative;
    z-index: 1;
}

.gll-currency, .gll-period {
    font-size: 24px;
    opacity: 0.9;
}

.gll-features {
    list-style: none;
    padding: 0;
    margin: 30px 0;
    text-align: left;
    position: relative;
    z-index: 1;
}

.gll-features li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    padding-left: 30px;
}

.gll-features li:before {
    content: "✓";
    color: #4CAF50;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 12px;
    width: 20px;
    height: 20px;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.gll-trial-info {
    background: rgba(76, 175, 80, 0.2);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid rgba(76, 175, 80, 0.3);
    position: relative;
    z-index: 1;
}

.gll-payment-methods {
    margin: 30px 0;
    position: relative;
    z-index: 1;
}

.gll-payment-method {
    margin: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.gll-payment-method:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

#gll-card-element {
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.1);
}

#gll-card-errors {
    color: #ff6b6b;
    margin: 10px 0;
    font-weight: 500;
}

/* Loading States */
.gll-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.gll-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .gll-container {
        padding: 15px;
    }
    
    .gll-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .gll-word-display {
        font-size: 32px;
    }
    
    .gll-quiz-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gll-level-filter button,
    .gll-level-btn {
        margin: 5px;
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .gll-articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .gll-price {
        font-size: 36px;
    }
    
    .gll-pricing-card {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .gll-container {
        padding: 10px;
    }
    
    .gll-card {
        padding: 15px;
		height: 120vh;
    }
    
    .gll-word-display {
        font-size: 28px;
    }
    
    .gll-quiz-option {
        padding: 15px;
        font-size: 14px;
    }
    
    .gll-button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* RTL Support for Persian */
[dir="rtl"] .gll-container {
    direction: rtl;
}

[dir="rtl"] .gll-features li {
    padding-right: 30px;
    padding-left: 0;
}

[dir="rtl"] .gll-features li:before {
    right: 0;
    left: auto;
}



/* Accessibility */
.gll-button:focus,
.gll-quiz-option:focus,
.gll-level-filter button:focus,
.gll-level-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .gll-button {
        border: 2px solid currentColor;
    }
    
    .gll-quiz-option {
        border-width: 3px;
    }
    
    .gll-level-filter button,
    .gll-level-btn {
        border-width: 3px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gll-button,
    .gll-quiz-option,
    .gll-article-card,
    .gll-level-filter button,
    .gll-level-btn {
        transition: none;
    }
    
    .gll-progress-fill::after {
        animation: none;
    }
    
    .gll-pricing-card::before {
        animation: none;
    }
}