/* 
   Cascep Ecuador - Design System
   Professional & Clean Web Styling 
   Retina/High-DPI Display Support
*/

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

img {
    image-rendering: -webkit-optimize-contrast;
}

:root {
    /* Color Palette - Original */
    --primary-color: #1a3a5f; /* Navy */
    --secondary-color: #00AEEF; /* Dynamic Cyan */
    --accent-color: #FFC107; /* Goldenrod/Yellow */
    --text-dark: #334155;
    --text-muted: #64748b;
    --bg-light: #f1f5f9;
    --white: #ffffff;
    
    /* Typography */
    --font-heading: 'Outfit', 'Montserrat', sans-serif;
    --font-body: 'Inter', 'Roboto', sans-serif;
    
    /* Spacing */
    --section-padding: 100px 0;
    --container-width: 1240px;
    
    /* Shadows */
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 20px 25px -5px rgba(0,0,0,0.1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

h1, h2, h3, h4, .heading {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--section-padding);
}

.flex {
    display: flex;
}

.grid {
    display: grid;
    gap: 20px;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Header Styles */
.main-header {
    width: 100%;
    transition: all 0.3s ease;
}

.header-transparent {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.header-transparent .desktop-nav a {
    color: var(--white);
}

.header-solid {
    background: var(--primary-color);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.header-solid .desktop-nav a {
    color: var(--white);
}

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

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

.tag-gold {
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    display: inline-block;
}

/* Split Stats Layout */
.stats-split {
    display: flex;
    flex-wrap: wrap;
    border-radius: 10px;
    overflow: hidden;
    margin-top: -50px;
    position: relative;
    z-index: 10;
    max-width: 100%;
}

.stats-left {
    flex: 1;
    min-width: 400px;
    background: var(--secondary-color);
    padding: 60px;
    color: #fff;
}

.stats-right {
    flex: 1;
    min-width: 400px;
    background: var(--accent-color);
    padding: 60px;
}

.grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.stat-item h3 {
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-item p {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

/* Presence Grid */
.city-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.city-item {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.city-item i {
    color: var(--secondary-color);
    font-size: 0.8rem;
}

/* Components Preview Styles (Placeholder for advances) */
.hero {
    background: linear-gradient(rgba(26, 58, 95, 0.8), rgba(26, 58, 95, 0.8)), url('../img/hero-bg.png');
    background-size: cover;
    background-position: center;
    color: var(--white);
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 150px 20px 140px 50px;
    max-width: 100vw;
    overflow: hidden;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-card {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    display: block;
}

/* Testimonials Carousel */
.testimonials-section {
    background: var(--primary-color);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.testimonials-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
}

.testimonial-slide {
    display: none;
    animation: fadeIn 0.5s ease;
}

.testimonial-slide.active {
    display: block;
}

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

.testimonial-content {
    text-align: center;
    padding: 20px;
}

.testimonial-text {
    font-size: 1.1rem;
    font-style: italic;
    opacity: 0.9;
    line-height: 1.8;
    margin-bottom: 40px;
}

.testimonial-author {
    display: inline-block;
}

.testimonial-author img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid var(--accent-color);
    padding: 3px;
    object-fit: cover;
}

.testimonial-author h4 {
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
}

.testimonial-author p {
    color: var(--secondary-color);
    font-size: 0.8rem;
    margin: 0;
}

.testimonial-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.testimonial-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.testimonial-dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

.testimonial-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.testimonial-nav:hover {
    background: var(--secondary-color);
}

.testimonial-prev {
    left: 10px;
}

.testimonial-next {
    right: 10px;
}

.whatsapp-btn {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 999;
            transition: transform 0.3s;
        }
        .whatsapp-btn:hover {
            transform: scale(1.1);
        }
/* Responsive Styles */

/* Tablets */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px 0;
    }
    
    .hero h1 {
        font-size: 3rem !important;
    }
    
    .stats-left, .stats-right {
        padding: 40px;
    }
    
    .grid-2x2 {
        gap: 25px;
    }
    
    .stat-item h3 {
        font-size: 2.2rem;
    }
    
    .city-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-pillars {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 100px 20px 60px 20px;
        min-height: 70vh;
    }
    
    .hero h1 {
        font-size: 2.2rem !important;
    }
    
    .hero .container {
        grid-template-columns: 1fr !important;
    }
    
    .hero .container > div:last-child {
        display: none;
    }
    
    .stats-split {
        flex-direction: column;
    }
    
    .stats-left, .stats-right {
        min-width: 100%;
        padding: 35px 25px;
    }
    
    .stats-left {
        border-radius: 20px 20px 0 0;
        margin-top: 70px;
    }
    
    .grid-2x2 {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .stat-item h3 {
        font-size: 1.8rem;
    }
    
    .stat-item p {
        font-size: 0.85rem;
    }
    
    .city-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .desktop-nav {
        display: none !important;
    }
    
    .section {
        padding: 60px 0;
    }
    
    h2 {
        font-size: 2rem !important;
    }
    
    .testimonial-nav {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .hero {
        padding: 90px 15px 50px 15px;
        min-height: 65vh;
    }
    
    .hero h1 {
        font-size: 1.8rem !important;
    }
    
    .hero p {
        font-size: 1rem !important;
    }
    
    .hero .flex {
        flex-direction: column;
        gap: 12px !important;
    }
    
    .hero .btn {
        width: 100%;
        text-align: center;
    }
    
    .stats-left h2 {
        font-size: 1.8rem !important;
    }
    
    .grid-2x2 {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .stat-item h3 {
        font-size: 1.5rem;
    }
    
    .stat-item p {
        font-size: 0.75rem;
    }
    
    .city-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .city-item {
        font-size: 0.85rem;
    }
    
    .course-card {
        min-width: 100% !important;
    }
    
    .testimonial-text {
        font-size: 1rem !important;
    }
    
    .testimonial-author img {
        width: 60px;
        height: 60px;
    }
    
    .testimonial-dots {
        gap: 8px;
    }
    
    .testimonial-dot {
        width: 10px;
        height: 10px;
    }
    
    .faq-container + .container,
    .container + .faq-container {
        grid-template-columns: 1fr !important;
    }
    
    .footer-pillars {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }
    
    .footer-pillars > div:first-child {
        border-radius: 20px 20px 0 0;
        padding: 30px !important;
    }
    
    .footer-pillars > div:last-child {
        padding-top: 30px !important;
    }
    
    .footer-pillars h3 {
        font-size: 1.5rem !important;
    }
    
    .footer-pillars h2 {
        font-size: 1.8rem !important;
    }
    
    .footer-pillars input,
    .footer-pillars textarea {
        font-size: 16px !important;
    }
    
    .courses-grid {
        grid-template-columns: 1fr !important;
    }
    
    .accreditation-grid {
        grid-template-columns: 1fr !important;
    }
    
    .accreditation-img {
        order: -1;
    }
    
    .accreditation-text {
        order: 1;
        text-align: center;
    }
    
    .hero-content {
        text-align: center !important;
    }
    
    .hero-content h1 {
        text-align: center !important;
    }
    
    .hero-content p {
        text-align: justify !important;
    }
    
    .hero-content .flex {
        justify-content: center;
    }
    
    .stats-left {
        text-align: center;
    }
    
    .stats-left h2 {
        text-align: center;
    }
    
    .stats-left p {
        text-align: justify;
    }
    
    .accreditation-grid > div {
        text-align: center;
    }
    
    .accreditation-grid h3 {
        text-align: center;
    }
    
    .accreditation-grid p {
        text-align: justify;
    }
    
    .about-section > div {
        text-align: center;
    }
    
    .about-grid > div {
        text-align: center;
    }
    
    .about-grid h2 {
        text-align: center;
    }
    
    .about-grid p {
        text-align: justify;
    }
}

/* Extra Small */
@media (max-width: 320px) {
    .hero h1 {
        font-size: 1.5rem !important;
    }
    
    .stat-item h3 {
        font-size: 1.3rem;
    }
    
    .grid-2x2 {
        gap: 10px;
    }
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none !important;
    text-transform: uppercase;
}

.desktop-nav a,
.mobile-nav a {
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important;
    }
    
    .mobile-nav ul {
        display: flex;
    }
    
    .mobile-nav a {
        display: block;
        padding: 10px;
    }
    
    .mobile-nav .btn {
        margin-top: 10px;
    }
}

/* Course Detail Responsive */
@media (max-width: 1024px) {
    .course-detail-grid {
        grid-template-columns: 1fr !important;
    }
    
    .course-detail-grid aside {
        order: -1;
    }
}

@media (max-width: 768px) {
    .course-detail-hero {
        padding: 80px 20px !important;
    }
    
    .course-detail-hero h1 {
        font-size: 2rem !important;
    }
    
    .course-detail-hero .flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .course-detail-hero span:first-of-type {
        font-size: 1.5rem !important;
    }
}

/* Contact Form */
.contact-form-container {
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .contact-form-container {
        padding: 0 15px;
    }
}

/* Nosotros Page */
@media (max-width: 768px) {
    .about-section {
        padding: 60px 20px !important;
    }
    
    .about-section .grid {
        grid-template-columns: 1fr !important;
    }
    
    .about-section img {
        order: -1;
    }
}

/* Footer Responsive */
@media (max-width: 768px) {
    .main-footer {
        padding: 40px 15px 20px !important;
    }
    
/* Admin Responsive */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 200px !important;
    }
    .admin-content {
        margin-left: 200px !important;
        padding: 30px !important;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 100% !important;
        height: auto !important;
        position: relative !important;
        padding: 20px !important;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .admin-sidebar img {
        display: none;
    }
    .admin-sidebar .nav-link {
        display: inline-block !important;
        margin-bottom: 0 !important;
        padding: 8px 12px !important;
        font-size: 0.9rem;
    }
    .admin-content {
        margin-left: 0 !important;
        padding: 20px !important;
    }
    .admin-content table {
        font-size: 0.85rem;
    }
    .header-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .admin-sidebar {
        justify-content: center;
    }
    .admin-content table {
        display: block;
        overflow-x: auto;
    }
}

/* Ecuador Map with Leaflet */
.ecuador-map-container {
    position: relative;
    width: 100%;
    height: 450px;
    z-index: 1;
}

#ecuador-map {
    height: 100%;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    z-index: 1;
    position: relative;
}

.city-marker {
    background: transparent !important;
    border: none !important;
}

.city-marker .leaflet-popup-content-wrapper {
    background: #00AEEF;
    color: #fff;
    border-radius: 5px;
    padding: 8px 12px;
    font-weight: 600;
}

.city-marker .leaflet-popup-tip {
    background: #00AEEF;
}

.city-marker .leaflet-popup-content {
    margin: 0;
    font-size: 13px;
}

.pulse-marker {
    animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 174, 239, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(0, 174, 239, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 174, 239, 0);
    }
}

@media (max-width: 768px) {
    #ecuador-map {
        height: 400px;
    }
}

@media (max-width: 480px) {
    #ecuador-map {
        height: 300px;
    }
}

/* City Tooltip Styles */
.city-tooltip {
    background: #1a3a5f !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 3px 8px !important;
    font-weight: 500 !important;
    font-size: 11px !important;
    white-space: nowrap;
}

.city-tooltip::before {
    border-right-color: #1a3a5f !important;
}

.leaflet-tooltip-left.city-tooltip::before {
    border-left-color: #1a3a5f !important;
}

/* National Presence Section */
.national-presence-grid {
    align-items: start;
}

.national-presence-text {
    text-align: left;
}

@media (max-width: 768px) {
    .national-presence-grid {
        grid-template-columns: 1fr !important;
    }
    
    .national-presence-text {
        text-align: center;
    }

    .events-grid {
        grid-template-columns: 1fr !important;
    }

    #coursesCarousel .grid {
        grid-template-columns: 1fr !important;
    }
}

#coursesCarousel {
    position: relative;
    padding: 0 40px;
}

#coursesCarousel .carousel-indicators {
    display: none;
}

#coursesCarousel .carousel-control-prev,
#coursesCarousel .carousel-control-next {
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
    z-index: 10;
}

#coursesCarousel .carousel-control-prev {
    left: 0;
}

#coursesCarousel .carousel-control-next {
    right: 0;
}

#coursesCarousel .carousel-control-prev-icon,
#coursesCarousel .carousel-control-next-icon {
    background-size: 50%;
    filter: invert(1);
}

#coursesCarousel .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 1024px) {
    #coursesCarousel .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Propuestas Grid - Desktop Base */
.propuestas-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px;
}

/* Propuestas Section - Hover Animations */
.propuesta-card {
    position: relative;
    overflow: hidden;
}

.propuesta-bg {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.propuesta-card:hover .propuesta-bg {
    transform: scale(1.1) rotate(2deg);
    filter: brightness(0.5);
}

.propuesta-card:hover .propuesta-overlay {
    background: rgba(26, 58, 95, 0.85);
}

.btn-vermas {
    transition: all 0.3s ease;
}

.propuesta-card:hover .btn-vermas {
    background: #fff;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Propuestas Grid Responsive */
@media (max-width: 768px) {
    .propuestas-grid {
        grid-template-columns: 1fr !important;
        gap: 40px;
    }
    
    .propuesta-card {
        height: 350px !important;
        margin-bottom: 10px;
    }
    
    .courses-header {
        display: flex;
    }
    
    .section-title {
        text-align: center !important;
        width: 100%;
    }
    
    .section-text {
        text-align: center !important;
    }
    
    .national-presence-grid {
        grid-template-columns: 1fr !important;
    }
    
    .national-presence-text {
        text-align: center !important;
    }
    
    .cta-section .container {
        text-align: center !important;
    }
    
    .cta-content {
        max-width: 100% !important;
        margin: 0 auto !important;
    }
    
    .stats-intro {
        text-align: center !important;
    }
    
    .stats-subtitle {
        font-size: 1.2rem !important;
        text-align: center !important;
    }
    
    /* Nosotros Page Mobile */
    .about-grid {
        grid-template-columns: 1fr !important;
    }
    
    .about-text {
        text-align: center !important;
    }
    
    .mission-vision-grid {
        grid-template-columns: 1fr !important;
    }
    
    .valores-grid-1,
    .valores-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
.ciudades-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Dropdown Menu Styles */
.dropdown-menu {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.dropdown-menu li a:hover {
    background: var(--secondary-color);
    color: #fff !important;
}
}

/* Dropdown Menu Styles */
.dropdown-menu {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.dropdown-menu li a:hover {
    background: var(--secondary-color);
    color: #fff !important;
}
}
