/**
 * LoL Rank Checker Plugin Styles
 * Professional orange/blue/white theme
 */

/* Reset and Base Styles */
.lol-rank-checker-container * {
    box-sizing: border-box;
}

.lol-rank-checker-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1e293b;
    line-height: 1.5;
}

/* Widget Container */
.rank-checker-widget {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
    border: 2px solid #f0f8ff;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Header */
.widget-header {
    text-align: center;
    margin-bottom: 28px;
}

.widget-title {
    color: #1e40af;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    margin-top: 0;
}

.widget-subtitle {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* Search Section */
.search-section {
    margin-bottom: 24px;
}

.input-group {
    position: relative;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
    background: #ffffff;
}

.search-btn {
    width: 100%;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    font-family: inherit;
}

.search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.search-btn:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* Region Selector */
.region-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.region-btn {
    padding: 8px 4px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #64748b;
    font-family: inherit;
}

.region-btn.active {
    border-color: #ff6b35;
    background: #ff6b35;
    color: white;
}

.region-btn:hover:not(.active) {
    border-color: #ff6b35;
    color: #ff6b35;
}

.region-btn:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* Loading Section */
.loading-section {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

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

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

.loading-text {
    color: #1e40af;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
}

.loading-subtext {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #1e40af);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
}

.loading-steps {
    text-align: left;
    max-width: 280px;
    margin: 0 auto;
}

.step {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #64748b;
}

.step.active {
    color: #ff6b35;
    font-weight: 500;
}

.step.completed {
    color: #10b981;
}

.step-icon {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.timer-display {
    color: #ff6b35;
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
}

/* Results Section */
.results-section {
    display: none;
    text-align: center;
    padding: 20px;
}

.rank-display {
    background: linear-gradient(135deg, #f0f8ff 0%, #ffffff 100%);
    border: 2px solid #1e40af;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 20px;
}

.rank-tier {
    font-size: 28px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 8px;
    margin-top: 0;
}

.rank-division {
    font-size: 18px;
    color: #ff6b35;
    font-weight: 600;
    margin-bottom: 16px;
}

.rank-lp {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 20px;
}

.rank-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.stat-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.search-again-btn {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-again-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.search-again-btn:focus {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

.support-section {
    text-align: center;
    margin-top: 8px;
}

.support-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-family: inherit;
}

.support-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.support-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.support-text {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
}

/* Error Handling */
.lol-rank-checker-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .rank-checker-widget {
        padding: 20px;
        margin: 10px;
    }
    
    .widget-title {
        font-size: 20px;
    }
    
    .rank-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .region-selector {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .rank-checker-widget {
        padding: 16px;
    }
    
    .widget-title {
        font-size: 18px;
    }
    
    .region-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .region-btn {
        padding: 6px 2px;
        font-size: 11px;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .rank-checker-widget,
    .search-btn,
    .region-btn,
    .search-again-btn,
    .support-btn {
        animation: none;
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
        border-top-color: #ff6b35;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .rank-checker-widget {
        border: 3px solid #000;
    }
    
    .search-input {
        border: 2px solid #000;
    }
    
    .region-btn {
        border: 2px solid #000;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .rank-checker-widget {
        background: #1e293b;
        border-color: #374151;
        color: #f1f5f9;
    }
    
    .widget-title {
        color: #60a5fa;
    }
    
    .widget-subtitle,
    .loading-subtext,
    .stat-label,
    .support-text {
        color: #94a3b8;
    }
    
    .search-input {
        background: #374151;
        border-color: #4b5563;
        color: #f1f5f9;
    }
    
    .region-btn {
        background: #374151;
        border-color: #4b5563;
        color: #94a3b8;
    }
    
    .stat-box {
        background: #374151;
        border-color: #4b5563;
    }
    
    .rank-display {
        background: linear-gradient(135deg, #1e293b 0%, #374151 100%);
        border-color: #60a5fa;
    }
}

/* Print Styles */
@media print {
    .loading-section,
    .search-section {
        display: none !important;
    }
    
    .results-section {
        display: block !important;
    }
    
    .rank-checker-widget {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Focus Visible for Better Accessibility */
.search-btn:focus-visible,
.region-btn:focus-visible,
.search-again-btn:focus-visible,
.support-btn:focus-visible {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

.search-input:focus-visible {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}