/*
 * STEMpie - Common Styles
 * Shared styles across all pages
 * Created: 2024
 */

/* CSS Variables */
:root {
    --primary-color: #5e35b1;
    --secondary-color: #3949ab;
    --accent-color: #7c4dff;
    --light-color: #e8eaf6;
    --dark-color: #1a237e;
    --success-color: #43a047;
    --warning-color: #ffb300;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Navigation Styles */
.navbar-brand {
    font-weight: 700;
    font-size: 2.25rem;
    position: relative;
    display: flex;
    align-items: center;
}

@media (min-width: 768px) {
    .navbar-brand {
        font-size: 2.7rem;
    }
}

.navbar-brand span {
    color: var(--accent-color);
}

.logo-pi {
    color: white !important;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Arial Unicode MS', 'Lucida Sans Unicode', 'Times New Roman', serif;
    position: absolute;
    top: 0.1rem;
    right: -0.8rem;
    line-height: 1;
}

@media (max-width: 767px) {
    .logo-pi {
        font-size: 1rem !important;
        top: 0.1rem !important;
        right: -0.5rem !important;
    }
}

@media (max-width: 576px) {
    .logo-pi {
        font-size: 0.9rem !important;
        right: -0.4rem !important;
        top: 0.05rem !important;
    }
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    margin-left: auto;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.nav-link {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color) !important;
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--accent-color) !important;
    font-weight: 600;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-mobile {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .btn-mobile {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(94, 53, 177, 0.9), rgba(57, 73, 171, 0.9)), url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&h=1080&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

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

.hero-section::before {
    content: "π";
    position: absolute;
    font-size: 15rem;
    opacity: 0.05;
    right: -3rem;
    top: -3rem;
    font-weight: bold;
    line-height: 1;
}

@media (min-width: 768px) {
    .hero-section::before {
        font-size: 30rem;
        right: -5rem;
        top: -5rem;
    }
}

/* Category Cards */
.category-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 100%;
    margin-bottom: 1.5rem;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .category-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
}

.english-card {
    background: linear-gradient(45deg, #1565c0, #2196f3);
    color: white;
}

.math-card {
    background: linear-gradient(45deg, #c2185b, #e91e63);
    color: white;
}

.science-card {
    background: linear-gradient(45deg, #00796b, #009688);
    color: white;
}

.tech-card {
    background: linear-gradient(45deg, #e65100, #f57c00);
    color: white;
}

.engineering-card {
    background: linear-gradient(45deg, #5d4037, #795548);
    color: white;
}

.competition-card {
    /* Remove purple background - use white background like STEM Teachers module */
    background: white;
    color: inherit;
}

/* Course Cards */
.course-card {
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    margin-bottom: 1.5rem;
}

.course-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem 0;
}

@media (min-width: 768px) {
    .footer {
        padding: 4rem 0 2rem 0;
    }
}

.footer li {
    margin-bottom: 0.5rem;
}

.footer h5 {
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Feature Icons */
.feature-icon {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .feature-icon {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
}

/* Mobile Optimization */
.mobile-padding {
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 768px) {
    .mobile-padding {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Enhanced Mobile Optimization */
@media (max-width: 767px) {
    /* Mobile hero section */
    .hero-section {
        padding: 2rem 0 !important;
        background-attachment: scroll !important;
    }
    
    .hero-section h1 {
        font-size: 1.8rem !important;
        line-height: 1.3;
        margin-bottom: 1rem !important;
    }
    
    .hero-section p {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-section .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Mobile category cards */
    .category-card {
        margin-bottom: 1rem !important;
        padding: 1.5rem !important;
    }
    
    .category-card h3 {
        font-size: 1.2rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .category-card p {
        font-size: 0.9rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Mobile course cards */
    .course-card {
        margin-bottom: 1rem !important;
    }
    
    .course-card h5 {
        font-size: 1rem !important;
        line-height: 1.3;
    }
    
    /* Mobile buttons */
    .btn {
        min-height: 48px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1rem !important;
        padding: 0.75rem 1.5rem !important;
    }
    
    .btn-sm {
        min-height: 40px !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .btn-lg {
        min-height: 56px !important;
        padding: 1rem 2rem !important;
        font-size: 1.1rem !important;
    }
    
    /* Mobile spacing */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Mobile navigation */
    .navbar-brand {
        font-size: 1.8rem !important;
        flex-shrink: 0;
    }
    
    .navbar-nav {
        margin-left: 0 !important;
        margin-top: 1rem !important;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0 !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
        font-size: 1rem !important;
    }
    
    /* Mobile container padding */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Mobile footer */
    .footer {
        padding: 2rem 0 1rem 0 !important;
    }
    
    .footer h5 {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
        font-weight: 600 !important;
    }
    
    .footer p, .footer li {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }
    
    .footer li {
        margin-bottom: 0.5rem !important;
    }
    
    .footer .social-icons {
        margin-top: 1.5rem !important;
    }
    
    .footer .social-icons a {
        font-size: 1.2rem !important;
        margin-right: 1rem !important;
        padding: 0.5rem !important;
        display: inline-block !important;
    }
    
    /* Mobile footer layout - Quick Links and Learning Areas side by side */
    .footer .row > div:nth-child(2),
    .footer .row > div:nth-child(3) {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 1.5rem !important;
    }
    
    .footer .row > div:nth-child(4) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Alternative selectors for better compatibility */
    .footer .col-lg-3.col-md-6:nth-of-type(2),
    .footer .col-lg-3.col-md-6:nth-of-type(3) {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 1.5rem !important;
    }
    
    .footer .col-lg-3.col-md-6:nth-of-type(4) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Force layout for all footer sections */
    .footer .row > .col-lg-3:nth-child(2),
    .footer .row > .col-lg-3:nth-child(3) {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 1.5rem !important;
    }
    
    .footer .row > .col-lg-3:nth-child(4) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Additional backup selectors */
    .footer .col-md-6:nth-child(2),
    .footer .col-md-6:nth-child(3) {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 1.5rem !important;
    }
    
    .footer .col-md-6:nth-child(4) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Mobile grid adjustments */
    .col-sm-6 {
        margin-bottom: 1rem;
    }
    
    /* Mobile text adjustments */
    .display-5 {
        font-size: 2rem !important;
    }
    
    .lead {
        font-size: 1.1rem !important;
    }
    
    /* Mobile icon sizing */
    .category-icon {
        font-size: 1.8rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .feature-icon {
        font-size: 1.3rem !important;
        margin-bottom: 0.5rem !important;
    }
}

/* Touch-friendly improvements */
@media (max-width: 767px) {
    .nav-link {
        padding: 0.75rem 0.5rem !important;
        font-size: 1.1rem !important;
    }
    
    .btn {
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    .btn-sm {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Better touch targets */
    a, button {
        min-height: 48px !important;
        min-width: 48px !important;
    }
    
    .nav-link {
        min-height: 50px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Improved spacing for mobile */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Mobile navbar improvements */
    .navbar {
        padding: 0.5rem 0 !important;
    }
    
    .navbar .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .navbar-brand {
        margin-right: 0 !important;
        padding: 0.5rem 0 !important;
    }
    
    .navbar-toggler {
        padding: 0.4rem 0.6rem !important;
        font-size: 1rem !important;
        border: none !important;
        border-radius: 0.375rem !important;
    }
    
    .navbar-toggler:focus {
        box-shadow: none !important;
    }
    
    .navbar-collapse {
        margin-top: 1rem !important;
        padding-top: 1rem !important;
        border-top: 1px solid rgba(255,255,255,0.1) !important;
    }
    
    .navbar-nav {
        margin-bottom: 1rem !important;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0 !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
        font-size: 1rem !important;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none !important;
    }
    
    /* Mobile card improvements */
    .card {
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    }
    
    .card-body {
        padding: 1.25rem !important;
    }
    
    /* Mobile form improvements */
    .form-control, .form-select {
        min-height: 48px !important;
        font-size: 1rem !important;
        padding: 0.75rem 1rem !important;
    }
    
    /* Mobile modal improvements */
    .modal-dialog {
        margin: 1rem !important;
    }
    
    .modal-body {
        padding: 1.5rem !important;
    }
    
    /* Mobile table improvements */
    .table-responsive {
        font-size: 0.9rem !important;
    }
    
    /* Mobile badge improvements */
    .badge {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.6rem !important;
    }
    
    /* Mobile image improvements */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Mobile text improvements */
    .display-5 {
        font-size: 2rem !important;
    }
    
    .display-6 {
        font-size: 1.5rem !important;
    }
    
    .lead {
        font-size: 1.1rem !important;
    }
    
    /* Mobile grid improvements */
    .row {
        margin-left: -10px !important;
        margin-right: -10px !important;
    }
    
    .col, .col-12, .col-sm-6, .col-md-4, .col-lg-3 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

@media (max-width: 767px) {
    .nav-link.active::after {
        width: 120px !important;
        left: 0 !important;
        transform: none !important;
    }
    
    /* Mobile navigation improvements */
    .navbar-collapse {
        background-color: rgba(0,0,0,0.95) !important;
        border-radius: 8px !important;
        margin-top: 1rem !important;
        padding: 1rem !important;
    }
    
    /* Mobile search improvements */
    .search-container {
        margin-bottom: 1rem !important;
    }
    
    .search-container .form-control {
        border-radius: 25px !important;
    }
    
    /* Mobile filter improvements */
    .filter-section {
        margin-bottom: 1rem !important;
    }
    
    .filter-section .btn {
        margin-bottom: 0.5rem !important;
    }
    
    /* Mobile competition card improvements */
    .competition-card {
        margin-bottom: 1rem !important;
    }
    
    .competition-card .card-body {
        padding: 1rem !important;
    }
    
    /* Mobile coach list improvements */
    .coach-list {
        gap: 0.5rem !important;
    }
    
    .coach-list .d-flex {
        min-width: 180px !important;
    }
}

/* Additional mobile optimizations */
@media (max-width: 576px) {
    /* Extra small devices */
    .hero-section h1 {
        font-size: 1.6rem !important;
    }
    
    .hero-section p {
        font-size: 0.95rem !important;
    }
    
    .navbar-brand {
        font-size: 1.6rem !important;
        flex-shrink: 0;
    }
    
    .logo-pi {
        font-size: 0.9rem !important;
        right: -0.4rem !important;
        top: 0.05rem !important;
    }
    
    .category-card {
        padding: 1rem !important;
    }
    
    .category-card h3 {
        font-size: 1.1rem !important;
    }
    
    .btn {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.95rem !important;
    }
    
    .btn-lg {
        padding: 0.8rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .row {
        margin-left: -5px !important;
        margin-right: -5px !important;
    }
    
    .col, .col-12, .col-sm-6, .col-md-4, .col-lg-3 {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    /* Extra small footer */
    .footer {
        padding: 1.5rem 0 1rem 0 !important;
    }
    
    .footer h5 {
        font-size: 1rem !important;
        margin-bottom: 0.8rem !important;
    }
    
    .footer p, .footer li {
        font-size: 0.85rem !important;
    }
    
    .footer .social-icons a {
        font-size: 1.1rem !important;
        margin-right: 0.8rem !important;
        padding: 0.4rem !important;
    }
}

/* Landscape mobile optimization */
@media (max-width: 767px) and (orientation: landscape) {
    .hero-section {
        padding: 1.5rem 0 !important;
    }
    
    .hero-section h1 {
        font-size: 1.5rem !important;
    }
    
    .py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* Touch feedback and animations */
@media (max-width: 767px) {
    /* Touch feedback for buttons */
    .btn:active {
        transform: scale(0.95) !important;
        transition: transform 0.1s ease !important;
    }
    
    /* Touch feedback for cards */
    .category-card:active,
    .course-card:active,
    .teacher-card:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease !important;
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth !important;
    }
    
    /* Better focus indicators */
    .btn:focus,
    .nav-link:focus,
    .form-control:focus,
    .form-select:focus {
        outline: 2px solid var(--accent-color) !important;
        outline-offset: 2px !important;
    }
    
    /* Improved loading states */
    .btn:disabled {
        opacity: 0.6 !important;
        cursor: not-allowed !important;
    }
    
    /* Better text selection */
    ::selection {
        background-color: var(--accent-color) !important;
        color: white !important;
    }
    
    /* Improved scrollbar */
    ::-webkit-scrollbar {
        width: 8px !important;
        height: 8px !important;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1 !important;
        border-radius: 4px !important;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #c1c1c1 !important;
        border-radius: 4px !important;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8 !important;
    }
}

/* Collapse panel icon transition */
[data-bs-target="#gradeFilterCollapse"] i {
    transition: transform 0.3s ease;
}

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Common animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Common shadows */
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.shadow-md {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.shadow-lg {
    box-shadow: 0 8px 16px rgba(0,0,0,0.2) !important;
}

/* Common border radius */
.rounded-sm {
    border-radius: 0.25rem !important;
}

.rounded-md {
    border-radius: 0.5rem !important;
}

.rounded-lg {
    border-radius: 1rem !important;
}

/* Common transitions */
.transition {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
} 