/**
 * Responsive Design - Mobile & Tablet
 * Modern & Adaptive Layout
 */

/* Tablet (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    :root {
        --spacing-xs: 0.375rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1.25rem;
        --spacing-lg: 1.75rem;
        --spacing-xl: 2.5rem;
        --spacing-2xl: 3rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .hero-content h1 {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid,
    .announcements-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-md);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

/* Mobile (max-width: 768px) */
@media screen and (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    /* Header */
    .site-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .header-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: var(--spacing-sm);
        padding: var(--spacing-md) 0;
    }
    
    .logo {
        flex-direction: row;
        gap: var(--spacing-sm);
    }
    
    .logo img {
        max-height: 40px;
        width: auto;
    }
    
    .logo-circle {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .logo-text h1 {
        font-size: 1.25rem;
    }
    
    .logo-subtitle {
        font-size: 0.625rem;
    }
    
    .header-right {
        flex-direction: row;
        gap: var(--spacing-sm);
        width: auto;
        align-items: center;
    }
    
    .language-switcher {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }
    
    .btn-login {
        display: none; /* Hide login button on mobile, will show in menu */
    }
    
    /* Mobile Menu Toggle Button */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px;
        z-index: 1001;
        position: relative;
    }
    
    .mobile-menu-toggle span {
        width: 100%;
        height: 3px;
        background: var(--primary-color);
        border-radius: 10px;
        transition: all 0.3s ease;
        transform-origin: center;
    }
    
    .mobile-menu-toggle:hover span {
        background: var(--secondary-color);
    }
    
    /* Active state (X icon) */
    body.mobile-menu-active .mobile-menu-toggle span:nth-child(1) {
        transform: rotate(45deg) translateY(12px);
    }
    
    body.mobile-menu-active .mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
    }
    
    body.mobile-menu-active .mobile-menu-toggle span:nth-child(3) {
        transform: rotate(-45deg) translateY(-12px);
    }
    
    /* Navigation */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        box-shadow: -5px 0 20px rgba(0,0,0,0.3);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        overflow-y: auto;
        z-index: 1000;
        padding-top: 80px;
    }
    
    body.mobile-menu-active .main-nav {
        right: 0;
    }
    
    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    body.mobile-menu-active .mobile-menu-overlay {
        opacity: 1;
        visibility: visible;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: var(--spacing-md);
    }
    
    .main-nav li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .main-nav li:last-child {
        border-bottom: none;
    }
    
    .main-nav a {
        padding: 1rem 1.25rem;
        color: white;
        font-weight: 500;
        border-left: 3px solid transparent;
        border-radius: 0;
        display: block;
    }
    
    .main-nav a::after {
        display: none;
    }
    
    .main-nav a:hover {
        background: rgba(255, 255, 255, 0.15);
        border-left-color: var(--accent-color);
    }
    
    .main-nav a.active {
        background: rgba(255, 255, 255, 0.2);
        border-left-color: var(--accent-color);
        font-weight: 600;
    }
    
    /* Mobile only menu items */
    .main-nav .mobile-only {
        display: block;
        border-top: 2px solid rgba(255, 255, 255, 0.2);
        margin-top: var(--spacing-sm);
        padding-top: var(--spacing-sm);
    }
    
    .main-nav .mobile-only a {
        background: rgba(255, 255, 255, 0.1);
    }
    
    /* Hero Section */
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-content h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
        margin-bottom: var(--spacing-md);
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: var(--spacing-lg);
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* Sections */
    .services-section,
    .announcements-section,
    .cta-section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: clamp(1.75rem, 4vw, 2.5rem);
        margin-bottom: var(--spacing-lg);
    }
    
    .section-header {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .section-header .section-title {
        text-align: center;
    }
    
    .section-header .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* Catalog Boxes */
    .catalog-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .catalog-box {
        padding: var(--spacing-md);
    }
    
    .catalog-icon {
        width: 70px;
        height: 70px;
    }
    
    .catalog-box h3 {
        min-height: auto;
        font-size: 1.125rem;
    }

    /* Service Cards */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .service-card {
        padding: var(--spacing-lg);
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
    
    /* Announcement Cards */
    .announcements-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .announcement-card {
        flex-direction: column;
        padding: var(--spacing-md);
    }
    
    .announcement-date {
        min-width: 100%;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: var(--spacing-sm);
        padding: var(--spacing-md);
    }
    
    .date-day {
        font-size: 2rem;
    }
    
    .date-month {
        font-size: 0.875rem;
    }
    
    /* CTA Section */
    .cta-content h2 {
        font-size: clamp(1.75rem, 4vw, 2.5rem);
    }
    
    .cta-content p {
        font-size: 1rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .pagination-link,
    .pagination-current {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Forms */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Extra Small Mobile (max-width: 480px) */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .logo-circle {
        width: 56px;
        height: 56px;
        font-size: 1.75rem;
    }
    
    .logo-text h1 {
        font-size: 1.25rem;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .hero-description {
        font-size: 0.9375rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .service-icon {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }
    
    .service-card h3 {
        font-size: 1.25rem;
    }
    
    .announcement-card {
        padding: var(--spacing-sm);
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .btn-large {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .social-links a {
        width: 44px;
        height: 44px;
        font-size: 1.125rem;
    }
}

/* Landscape Mobile (max-height: 500px and orientation: landscape) */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 0.9375rem;
        margin-bottom: var(--spacing-md);
    }
    
    .services-section,
    .announcements-section,
    .cta-section {
        padding: 2rem 0;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .search-form,
    .btn,
    .pagination,
    .hero-buttons {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: white;
    }
    
    .hero-section {
        background: none;
        color: #000;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    .announcement-card,
    .service-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Kullanıcı dark mode tercih ederse burada stiller eklenebilir */
    /* Şimdilik devre dışı */
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }
    
    .main-nav a {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .social-links a {
        min-width: 48px;
        min-height: 48px;
    }
}
