/* ========================================================
   LPS MIRCEA ELIADE - RESPONSIVE STYLES
   Optimizări pentru mobil și tabletă
   ======================================================== */

/* ===== BREAKPOINTS =====
   - Desktop: > 1200px
   - Laptop: 1024px - 1200px
   - Tablet: 768px - 1024px
   - Mobil: 576px - 768px
   - Telefon mic: < 576px
   ======================== */

/* ===== CONTAINER RESPONSIVE ===== */
.container {
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

@media (min-width: 576px) {
    .container { max-width: 540px; margin: 0 auto; }
}

@media (min-width: 768px) {
    .container { max-width: 720px; }
}

@media (min-width: 992px) {
    .container { max-width: 960px; }
}

@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

@media (min-width: 1400px) {
    .container { max-width: 1320px; }
}

/* ===== TABLET (768px - 1024px) ===== */
@media (max-width: 1024px) and (min-width: 768px) {
    /* Secțiuni */
    .section {
        padding: 60px 0;
    }
    
    /* Grid-uri */
    .services-grid,
    .sports-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Hero */
    .hero-section h1,
    .page-hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p,
    .page-hero p {
        font-size: 1.1rem;
    }
    
    /* Stats */
    .hero-stats {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .hero-stat {
        flex: 0 0 45%;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== MOBIL (576px - 768px) ===== */
@media (max-width: 768px) {
    /* Tipografie */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    
    /* Secțiuni */
    .section {
        padding: 50px 0;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    /* Grid-uri - o coloană */
    .services-grid,
    .sports-grid,
    .news-grid,
    .catedre-grid,
    .proiecte-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Hero */
    .hero-section {
        min-height: auto;
        padding: 100px 0 60px;
    }
    
    .hero-section h1,
    .page-hero h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .hero-section p,
    .page-hero p {
        font-size: 1rem;
    }
    
    /* Stats */
    .hero-stats {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .hero-stat {
        width: 100%;
        max-width: 250px;
    }
    
    /* Butoane */
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Cards */
    .card,
    .news-card,
    .service-card {
        padding: 20px;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* Tabele */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    /* Quick Access */
    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .quick-access-card {
        padding: 16px;
    }
    
    .quick-access-card i {
        font-size: 1.5rem;
    }
    
    /* Sport Details */
    .sport-details-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact Form */
    .contact-form {
        padding: 20px;
    }
    
    /* Timeline */
    .timeline-step {
        padding: 20px;
    }
}

/* ===== TELEFON MIC (< 576px) ===== */
@media (max-width: 576px) {
    /* Container */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Tipografie */
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }
    
    body {
        font-size: 15px;
    }
    
    /* Secțiuni */
    .section {
        padding: 40px 0;
    }
    
    /* Hero */
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .hero-section p {
        font-size: 0.95rem;
    }
    
    /* Page Header */
    .page-header,
    .page-hero {
        padding: 80px 0 40px;
    }
    
    .page-hero h1 {
        font-size: 1.5rem;
    }
    
    /* Cards */
    .card,
    .news-card,
    .service-card {
        padding: 16px;
        border-radius: 12px;
    }
    
    /* Quick Access */
    .quick-access-grid {
        grid-template-columns: 1fr;
    }
    
    /* Butoane */
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    /* Coaches Grid */
    .coaches-grid {
        grid-template-columns: 1fr;
    }
    
    /* Features List */
    .feature-list li {
        padding: 12px 0;
    }
    
    /* Quote Section */
    .quote-section {
        padding: 40px 0;
    }
    
    .quote-section blockquote p {
        font-size: 1.1rem;
    }
    
    /* Footer */
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* Topbar - ascunde pe telefoane mici */
    .topbar {
        display: none;
    }
    
    /* Header compact */
    .header-main {
        padding: 10px 0;
    }
    
    .logo-img {
        height: 40px;
    }
    
    /* Hide logo text on very small screens */
    .logo-text {
        display: none;
    }
}

/* ===== TOUCH DEVICE IMPROVEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Butoane mai mari pentru touch */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Links mai mari */
    .nav-link,
    .dropdown-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Remove hover effects */
    .card:hover,
    .news-card:hover,
    .service-card:hover {
        transform: none;
    }
    
    /* Active states instead */
    .btn:active {
        transform: scale(0.98);
    }
    
    .card:active {
        transform: scale(0.99);
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 60px 0;
    }
    
    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .hero-stat {
        flex: 0 0 auto;
    }
}

/* ===== NAV OVERLAY ===== */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== MOBILE TOGGLE ANIMATION ===== */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-toggle span:nth-child(1) {
    transform: translateY(-6px);
}

.mobile-toggle span:nth-child(3) {
    transform: translateY(6px);
}

/* Hamburger to X animation */
.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(0);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(0);
}

@media (max-width: 1024px) {
    .mobile-toggle {
        display: flex;
    }
}

/* ===== SAFE AREA FOR NOTCHED DEVICES ===== */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* ===== IMAGE RESPONSIVE ===== */
img {
    max-width: 100%;
    height: auto;
}

/* ===== VIDEO RESPONSIVE ===== */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===== HIDE/SHOW UTILITIES ===== */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
}

.hide-tablet {
    display: block;
}

.show-tablet {
    display: none;
}

@media (max-width: 1024px) and (min-width: 769px) {
    .hide-tablet {
        display: none !important;
    }
    
    .show-tablet {
        display: block !important;
    }
}

/* ========================================================
   OPTIMIZĂRI MOBILE SUPLIMENTARE - Ianuarie 2025
   ======================================================== */

/* ===== FORMULARE MOBILE ===== */
@media (max-width: 768px) {
    /* Input fields mai mari pentru touch */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="date"],
    textarea,
    select {
        min-height: 48px;
        font-size: 16px; /* Previne zoom pe iOS */
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    /* Labels mai vizibile */
    label {
        font-size: 0.9rem;
        margin-bottom: 8px;
        display: block;
    }
    
    /* Form groups */
    .form-group {
        margin-bottom: 20px;
    }
    
    /* Submit buttons full width */
    form .btn[type="submit"],
    form button[type="submit"] {
        width: 100%;
        min-height: 48px;
    }
    
    /* Contact form specific */
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== GALERIE / IMAGINI MOBILE ===== */
@media (max-width: 768px) {
    .gallery-grid,
    .galerie-grid,
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .gallery-item img,
    .galerie-item img {
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .gallery-grid,
    .galerie-grid,
    .photo-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ===== TABELE RESPONSIVE ===== */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }
    
    table {
        min-width: 600px;
    }
    
    table th,
    table td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    /* Tabele card-style pentru mobile */
    table.mobile-cards {
        min-width: auto;
    }
    
    table.mobile-cards thead {
        display: none;
    }
    
    table.mobile-cards tbody tr {
        display: block;
        margin-bottom: 16px;
        background: #fff;
        border-radius: 12px;
        padding: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    table.mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
    }
    
    table.mobile-cards tbody td:last-child {
        border-bottom: none;
    }
    
    table.mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #1a1a4e;
    }
}

/* ===== TIMELINE MOBILE ===== */
@media (max-width: 768px) {
    .timeline {
        padding-left: 20px;
    }
    
    .timeline::before {
        left: 8px;
    }
    
    .timeline-item {
        padding-left: 30px;
        margin-bottom: 24px;
    }
    
    .timeline-item::before {
        left: 0;
        width: 16px;
        height: 16px;
    }
    
    .timeline-date {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .timeline-content {
        padding: 16px;
    }
}

/* ===== ACCORDION / FAQ MOBILE ===== */
@media (max-width: 768px) {
    .accordion-header,
    .faq-question {
        padding: 16px;
        font-size: 1rem;
    }
    
    .accordion-content,
    .faq-answer {
        padding: 16px;
    }
}

/* ===== MODALS / POPUP MOBILE ===== */
@media (max-width: 768px) {
    .modal,
    .popup {
        padding: 16px;
        margin: 16px;
        width: calc(100% - 32px);
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header,
    .popup-header {
        padding: 16px;
    }
    
    .modal-body,
    .popup-body {
        padding: 16px;
    }
    
    .modal-footer,
    .popup-footer {
        padding: 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .btn,
    .popup-footer .btn {
        width: 100%;
    }
}

/* ===== TABS MOBILE ===== */
@media (max-width: 768px) {
    .tabs,
    .tab-list {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .tabs::-webkit-scrollbar,
    .tab-list::-webkit-scrollbar {
        display: none;
    }
    
    .tab,
    .tab-item {
        min-width: auto;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ===== CARDS SPECIALE MOBILE ===== */
@media (max-width: 768px) {
    /* Sport cards */
    .sport-card {
        padding: 16px;
    }
    
    .sport-card-img {
        height: 180px;
    }
    
    /* News cards */
    .news-card-img,
    .stire-img {
        height: 180px;
    }
    
    /* Team cards */
    .team-card,
    .coach-card {
        padding: 16px;
        text-align: center;
    }
    
    .team-card-img,
    .coach-img {
        width: 100px;
        height: 100px;
        margin: 0 auto 12px;
    }
    
    /* Stats cards */
    .stat-card,
    .statistica-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* ===== BREADCRUMB MOBILE ===== */
@media (max-width: 576px) {
    .breadcrumb {
        padding: 12px 0;
        font-size: 0.8rem;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 6px;
    }
    
    /* Hide middle items, show only first and last */
    .breadcrumb-item:not(:first-child):not(:last-child) {
        display: none;
    }
    
    .breadcrumb-item:nth-last-child(2)::after {
        content: "...";
        padding: 0 8px;
        color: #666;
    }
}

/* ===== PAGINATION MOBILE ===== */
@media (max-width: 576px) {
    .pagination {
        justify-content: center;
        gap: 4px;
    }
    
    .pagination-item,
    .page-link {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
        font-size: 0.9rem;
    }
    
    /* Show only prev, current, next on mobile */
    .pagination-item:not(.active):not(:first-child):not(:last-child) {
        display: none;
    }
}

/* ===== BACK TO TOP MOBILE ===== */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}

/* ===== CHATBOT / FLOATING BUTTONS MOBILE ===== */
@media (max-width: 768px) {
    .chatbot-toggle,
    .chat-widget-toggle {
        bottom: 70px;
        right: 16px;
        width: 50px;
        height: 50px;
    }
    
    .chatbot-window,
    .chat-widget {
        bottom: 130px;
        right: 8px;
        left: 8px;
        width: auto;
        max-height: 60vh;
    }
}

/* ===== COOKIE BANNER MOBILE ===== */
@media (max-width: 576px) {
    .cookie-consent,
    .cookie-banner {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }
    
    .cookie-consent-buttons,
    .cookie-banner-buttons {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .cookie-consent-buttons .btn,
    .cookie-banner-buttons .btn {
        width: 100%;
    }
}

/* ===== SCROLL HORIZONTAL PE MOBILE ===== */
@media (max-width: 768px) {
    .horizontal-scroll {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 16px;
        padding-bottom: 16px;
    }
    
    .horizontal-scroll > * {
        scroll-snap-align: start;
        flex: 0 0 auto;
        width: 80vw;
        max-width: 300px;
    }
    
    .horizontal-scroll::-webkit-scrollbar {
        height: 4px;
    }
    
    .horizontal-scroll::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.2);
        border-radius: 4px;
    }
}

/* ===== TEXT TRUNCATION MOBILE ===== */
@media (max-width: 576px) {
    .text-truncate-mobile {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .text-truncate-mobile-2 {
        -webkit-line-clamp: 2;
    }
}

/* ===== PRINT STYLES MOBILE (fără) ===== */
@media print {
    .mobile-toggle,
    .nav-overlay,
    .back-to-top,
    .chatbot-toggle,
    .cookie-consent {
        display: none !important;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== DARK MODE MOBILE ===== */
@media (prefers-color-scheme: dark) {
    /* Ajustări pentru dark mode pe mobile dacă e necesar */
}

/* ===== FIX-URI SUPLIMENTARE MOBILE ===== */
@media (max-width: 768px) {
    /* Footer newsletter responsive */
    .footer-newsletter {
        padding: 30px 20px;
        margin-bottom: 40px;
    }
    
    .footer-newsletter h3 {
        font-size: 1.3rem;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }
    
    /* Footer contact list */
    .footer-contact .contact-list li {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .footer-contact .contact-list li i {
        margin-right: 0;
    }
    
    /* Footer bottom links */
    .footer-bottom-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .footer-bottom-links .separator {
        display: none;
    }
    
    /* Hero stats compact pe mobil */
    .hero-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .hero-stat {
        padding: 16px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
    }
    
    .hero-stat-number {
        font-size: 2rem;
    }
    
    .hero-stat-label {
        font-size: 0.85rem;
    }
    
    /* Mission cards grid */
    .mission-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    /* Services grid */
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    /* Portfolio filters scrollable */
    .portfolio-filters {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 12px;
        scrollbar-width: none;
    }
    
    .portfolio-filters::-webkit-scrollbar {
        display: none;
    }
    
    .portfolio-filter {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    /* Hero stats 2x2 pe telefoane */
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .hero-stat {
        padding: 12px;
    }
    
    .hero-stat-number {
        font-size: 1.75rem;
    }
    
    /* Footer foarte compact */
    .footer {
        padding: 40px 0 0;
    }
    
    .footer-about,
    .footer-links,
    .footer-contact {
        margin-bottom: 24px;
    }
    
    .footer-social a {
        width: 44px;
        height: 44px;
    }
    
    /* Contact cards stacked */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-info-cards {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .contact-info-card {
        flex-direction: row;
        text-align: left;
        gap: 16px;
    }
}
