/*
Theme Name: Maths Icon
Theme URI: https://mathsicon.com
Author: Maths Icon Team
Author URI: https://mathsicon.com
Description: A vibrant, modern theme for Maths Icon - inspiring young mathematicians across the UK
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: maths-icon
*/

/* ===================================
   CSS RESET & BASE STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Vibrant Brand Colors */
    --primary-purple: #7C3AED;
    --primary-orange: #F97316;
    --primary-blue: #3B82F6;
    --primary-pink: #EC4899;
    --primary-green: #10B981;
    --primary-yellow: #FCD34D;
    
    /* Neutrals */
    --dark: #1F2937;
    --gray: #6B7280;
    --light-gray: #F3F4F6;
    --white: #FFFFFF;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7C3AED 0%, #F97316 100%);
    --gradient-secondary: linear-gradient(135deg, #3B82F6 0%, #EC4899 100%);
    --gradient-accent: linear-gradient(135deg, #10B981 0%, #FCD34D 100%);
    
    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.7;
    color: var(--dark);
    background-color: var(--white);
    overflow-x: hidden;
}

/* ===================================
   TYPOGRAPHY
   =================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--dark);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1.2rem;
    line-height: 1.8;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-purple);
}

/* ===================================
   CONTAINER & LAYOUT
   =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.wide-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section-alt {
    background-color: var(--light-gray);
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.site-logo img {
    height: 60px;
    width: auto;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.main-navigation a {
    color: var(--dark);
    font-weight: 600;
    font-size: 16px;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.main-navigation a:hover {
    background: var(--gradient-primary);
    color: var(--white);
    transform: translateY(-2px);
}

/* Active Page Indicators - VISIBLE! */
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current_page_parent > a,
.main-navigation .current_page_ancestor > a,
.main-navigation a.active {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* Active page dot indicator */
.main-navigation .current-menu-item > a::after,
.main-navigation .current_page_item > a::after,
.main-navigation .current_page_parent > a::after,
.main-navigation .current_page_ancestor > a::after,
.main-navigation a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary-orange);
    border-radius: 50%;
}
    animation: slideInUnderline 0.3s ease;
}

@keyframes slideInUnderline {
    from {
        width: 0;
        opacity: 0;
        left: 50%;
        right: 50%;
    }
    to {
        left: 15px;
        right: 15px;
        opacity: 1;
    }
}

/* Hover state for non-active items */
.main-navigation li:not(.current-menu-item):not(.current_page_item) a:hover {
    background: var(--gradient-primary);
    color: var(--white);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--dark);
}

/* ===================================
   HERO SECTION
   =================================== */
.hero-section {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::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 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    text-align: left;
    position: relative;
    z-index: 1;
}

.hero-text {
    padding-right: 20px;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    animation: fadeInRight 1s ease;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.5rem;
    opacity: 0.95;
    margin-bottom: 30px;
    animation: fadeInUp 1s ease 0.2s backwards;
}

/* Approach content with image */
.approach-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    margin: 40px auto 0;
}

.approach-text {
    padding-right: 20px;
}

.approach-image img {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 968px) {
    .hero-content-split {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-text {
        padding-right: 0;
    }
    
    .approach-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .approach-text {
        padding-right: 0;
        text-align: center;
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===================================
   ANIMATED COUNTERS
   =================================== */
.impact-metrics {
    background: var(--white);
    padding: 80px 0;
    text-align: center;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.metric-card {
    padding: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease backwards;
}

.metric-card:nth-child(1) {
    background: var(--gradient-primary);
    animation-delay: 0.1s;
}

.metric-card:nth-child(2) {
    background: var(--gradient-secondary);
    animation-delay: 0.2s;
}

.metric-card:nth-child(3) {
    background: var(--gradient-accent);
    animation-delay: 0.3s;
}

.metric-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.metric-number {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 10px;
    font-family: var(--font-heading);
}

.metric-label {
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.95;
}

/* ===================================
   HEADLINES/STATISTICS SECTION - NEWS STYLE
   =================================== */
.stats-headlines {
    background: var(--light-gray);
    padding: 80px 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.news-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary-orange);
    position: relative;
    animation: fadeInUp 0.6s ease backwards;
}

.news-card:nth-child(2) {
    border-top-color: var(--primary-purple);
}

.news-card:nth-child(3) {
    border-top-color: var(--primary-blue);
}

.news-card:nth-child(4) {
    border-top-color: var(--primary-green);
}

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

.news-category {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--primary-orange);
    margin-bottom: 15px;
    display: inline-block;
    padding: 4px 12px;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 20px;
}

.news-card:nth-child(2) .news-category {
    color: var(--primary-purple);
    background: rgba(124, 58, 237, 0.1);
}

.news-card:nth-child(3) .news-category {
    color: var(--primary-blue);
    background: rgba(59, 130, 246, 0.1);
}

.news-card:nth-child(4) .news-category {
    color: var(--primary-green);
    background: rgba(16, 185, 129, 0.1);
}

.news-headline {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--dark);
    margin-bottom: 20px;
    font-family: var(--font-heading);
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--light-gray);
}

.news-source {
    font-size: 0.9rem;
    color: var(--gray);
    font-style: italic;
    font-weight: 500;
}

.news-icon {
    font-size: 1.5rem;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-headline {
        font-size: 1.2rem;
    }
}

/* ===================================
   SOLUTIONS SECTION
   =================================== */
.solutions-section {
    padding: 80px 0;
    background: var(--white);
}

.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.solution-card {
    padding: 40px;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s ease;
    animation: zoomIn 0.6s ease backwards;
}

.solution-card:nth-child(2) {
    background: var(--gradient-secondary);
    animation-delay: 0.1s;
}

.solution-card:nth-child(3) {
    background: var(--gradient-accent);
    animation-delay: 0.2s;
}

.solution-card:hover {
    transform: scale(1.05);
}

.solution-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
    display: inline-block;
    padding: 15px 35px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.6);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: var(--white);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.6);
}

.btn-outline {
    background: transparent;
    color: var(--primary-purple);
    border: 2px solid var(--primary-purple);
}

.btn-outline:hover {
    background: var(--primary-purple);
    color: var(--white);
}

/* ===================================
   FORMS
   =================================== */
.form-container {
    background: var(--white);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-group label.required::after {
    content: ' *';
    color: var(--primary-orange);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-control.error {
    border-color: #EF4444;
}

.error-message {
    color: #EF4444;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* ===================================
   DONATION CARDS
   =================================== */
.donation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.donation-card {
    background: var(--white);
    border: 3px solid var(--light-gray);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.donation-card:hover {
    border-color: var(--primary-purple);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(124, 58, 237, 0.2);
}

.donation-amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-purple);
    margin-bottom: 15px;
}

.donation-description {
    font-size: 1rem;
    color: var(--gray);
    margin-bottom: 25px;
    line-height: 1.6;
}

.donation-card .btn {
    width: 100%;
}

/* ===================================
   UK MAP SECTION
   =================================== */
.map-section {
    padding: 80px 0;
    background: var(--light-gray);
    text-align: center;
}

.map-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.map-container img {
    max-width: 100%;
    height: auto;
}

/* ===================================
   ABOUT SECTION
   =================================== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 60px;
}

.about-image {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

.founder-section {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 60px;
    border-radius: 20px;
    margin: 60px 0;
}

.founder-signature {
    margin-top: 30px;
    font-style: italic;
    font-size: 1.2rem;
}

/* ===================================
   FOOTER
   =================================== */
.site-footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 20px;
}

.footer-nav {
    list-style: none;
}

.footer-nav li {
    margin-bottom: 10px;
}

.footer-nav a {
    color: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}

.footer-nav a:hover {
    color: var(--primary-orange);
    padding-left: 5px;
}

.contact-info {
    list-style: none;
}

.contact-info li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.4);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===================================
   ANIMATIONS & EFFECTS
   =================================== */

/* Card Hover Effects */
.news-card,
.solution-card,
.donation-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.news-card:hover,
.solution-card:hover,
.donation-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Image Hover Effects */
.about-image img,
.hero-image img,
.approach-image img {
    transition: transform 0.5s ease;
}

.about-image img:hover,
.hero-image img:hover,
.approach-image img:hover {
    transform: scale(1.05);
}

/* Button Pulse Animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.btn-primary:hover {
    animation: pulse 0.6s ease-in-out;
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.metric-icon {
    animation: float 3s ease-in-out infinite;
}

/* Slide In Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
   
/* Donation Grid Responsive */
@media (max-width: 1400px) {
    div[style*="repeat(auto-fit, minmax(220px, 1fr))"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 900px) {
    div[style*="repeat(auto-fit, minmax(220px, 1fr))"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    div[style*="repeat(auto-fit, minmax(220px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }
}

/* Charts Responsive */
@media (max-width: 968px) {
    div[style*="grid-template-columns: 1fr 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    div[style*="grid-template-columns: 1fr 2fr 1fr"] > div {
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.5rem; }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        padding: 20px;
    }
    
    .main-navigation.active {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Active page on mobile */
    .main-navigation .current-menu-item > a,
    .main-navigation .current_page_item > a,
    .main-navigation a.active {
        background: var(--gradient-primary);
        color: var(--white);
        box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    }
    
    .main-navigation .current-menu-item > a::after,
    .main-navigation .current_page_item > a::after,
    .main-navigation a.active::after {
        display: none; /* Hide dot on mobile */
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .solutions-grid {
        grid-template-columns: 1fr;
    }
    
    .donation-grid {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 50px 0;
    }
    
    .form-container {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .metric-number {
        font-size: 3rem;
    }
    
    .donation-amount {
        font-size: 2.5rem;
    }
    
    .site-logo img {
        height: 45px;
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.hidden { display: none; }
.visible { display: block; }
