/**
 * AllThingsIELTS.com - Custom Styles
 * Enhances Bootstrap 5 with custom IELTS-specific styling
 */

/* Custom CSS Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Global Enhancements */
body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
}

/* Custom Card Hover Effects */
.hover-shadow {
    transition: box-shadow 0.3s ease-in-out;
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Custom Button Styles */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease-in-out;
}

/* New Components for Enhanced IELTS Site */

/* Alert Boxes */
.alert-box {
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.alert-box.urgent {
    background: #fee;
    border: 2px solid #f00;
    color: #900;
}

.alert-box.info {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    color: #0d47a1;
}

/* Statistics Display */
.stats-row {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
}

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

.stat-box .number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
}

.stat-box .label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Band Score Display */
.overall-score-display {
    text-align: center;
    padding: 2rem;
}

.overall-score-display .score-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--success-color);
}

/* Conversion Tables */
.requirements-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.requirements-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.requirements-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

/* Tool Cards */
.tool-card, .topic-card, .country-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Responsive Grids */
.tools-grid, .topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Flashcard Styles */
.flashcard-container {
    max-width: 500px;
    margin: 0 auto;
}

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

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

.flashcard .front,
.flashcard .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px solid var(--primary-color);
    border-radius: 1rem;
    background: white;
}

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

/* Timeline Styles */
.timeline-container {
    position: relative;
    padding: 2rem 0;
}

.timeline-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: -2rem;
    width: 2px;
    background: #ddd;
}

.timeline-item.current::before {
    background: var(--danger-color);
}

.timeline-item .date {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Progress Tracker */
.progress-tracker {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.skill-tracker {
    margin-bottom: 1.5rem;
}

.progress-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Study Plan Cards */
.plan-card {
    cursor: pointer;
    transition: all 0.3s;
}

.plan-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.plan-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* Question Type Cards */
.question-type {
    padding: 1.5rem;
    background: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
}

/* Word Counter Display */
.counter-display {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.counter-display span {
    font-size: 0.875rem;
}

.counter-display strong {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .tools-grid, 
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        flex-wrap: wrap;
    }
    
    .stat-box {
        flex: 0 0 50%;
        margin-bottom: 1rem;
    }
    
    table {
        font-size: 14px;
    }
    
    .timeline-item {
        padding-left: 25px;
    }
    
    .overall-score-display .score-number {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
    }
    
    a[href]:after {
        content: none !important;
    }
}

/* 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: 0;
}

/* Focus Styles */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading States */
.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Hero Section Enhancements */
.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #084298 100%) !important;
}

/* Interactive Elements */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Badge Enhancements */
.badge {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

/* Custom Spacing Utilities */
.section-padding {
    padding: 3rem 0;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 5rem 0;
    }
}

/* Typography Enhancements */
.display-4 {
    font-weight: 700;
    line-height: 1.2;
}

.lead {
    font-size: 1.15rem;
    font-weight: 400;
}

/* Accessibility Improvements */
.visually-hidden-focusable:focus {
    position: absolute !important;
    width: auto !important;
    height: auto !important;
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: nowrap !important;
    background-color: var(--primary-color) !important;
    color: white !important;
    text-decoration: none !important;
    border-radius: 0.25rem !important;
    z-index: 9999 !important;
}

/* Mobile Optimizations */
@media (max-width: 767.98px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Custom Text Colors */
.text-light-emphasis {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* AdSense Container Styling */
.adsbygoogle {
    display: block;
    margin: 1rem auto;
    text-align: center;
}

/* Navbar Enhancements */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
}

/* Footer Enhancements */
footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

footer .form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

footer .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

footer .form-control:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
}

/* Scroll Behavior */
html {
    scroll-behavior: smooth;
}