/**
 * responsive.css - CSS Responsive untuk website Trah Karyo Raharjo
 */

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .section-padding {
        padding: 100px 0;
    }
}

/* Large devices (desktops, 992px to 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .section-padding {
        padding: 80px 0;
    }
    
    .site-title {
        font-size: 2.8rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
}

/* Medium devices (tablets, 768px to 991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    .section-padding {
        padding: 60px 0;
    }
    
    /* Header adjustments */
    .header-inner {
        flex-wrap: wrap;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        margin-top: 20px;
        display: none;
    }
    
    .main-nav.show {
        display: block;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 10px;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
    
    /* Hero section */
    .hero-section {
        height: 60vh;
    }
    
    .site-title {
        font-size: 2.4rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Features grid */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

/* Small devices (landscape phones, 576px to 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 20px;
    }
    
    .section-padding {
        padding: 50px 0;
    }
    
    /* Header */
    .logo-text h1 {
        font-size: 1.5rem;
    }
    
    .logo-text p {
        font-size: 0.8rem;
    }
    
    /* Hero section */
    .hero-section {
        height: 50vh;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .site-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Features grid */
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    /* Form adjustments */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-group.full-width {
        grid-column: 1;
    }
    
    /* Tree controls */
    .controls-grid {
        flex-direction: column;
        gap: 20px;
    }
    
    .control-group {
        width: 100%;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
    }
    
    /* Gallery */
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
    .container {
        padding: 0 15px;
    }
    
    /* Typography */
    .site-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    /* Hero section */
    .hero-section {
        height: 40vh;
        padding: 20px;
    }
    
    .hero-content {
        padding: 20px;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Forms */
    .form-container {
        padding: 20px;
    }
    
    /* Steps in forms */
    .form-step .step-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* Gallery */
    .gallery-container {
        grid-template-columns: 1fr;
    }
    
    /* Tree visualization */
    .tree-container {
        padding: 10px;
        overflow-x: auto;
    }
    
    .tree-node {
        min-width: 150px;
        margin: 10px;
    }
    
    /* Tables */
    table {
        display: block;
        overflow-x: auto;
    }
    
    /* Cards */
    .card {
        padding: 15px;
    }
    
    /* Statistics */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-item {
        padding: 15px;
    }
    
    /* Modal */
    .modal-dialog {
        margin: 10px;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.9rem;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --sogan: #000000;
        --antique-white: #ffffff;
        --sumi-black: #000000;
    }
    
    body {
        background: #fff;
        color: #000;
    }
    
    a {
        text-decoration: underline;
    }
}

/* 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 */
@media (prefers-color-scheme: dark) {
    :root {
        --sogan: #a67c52;
        --antique-white: #1a1a1a;
        --sumi-black: #e0e0e0;
        --cream: #2a2a2a;
    }
    
    body {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    .feature-card,
    .announcement-card,
    .branch-card,
    .member-detail-card {
        background-color: #2a2a2a;
        color: #e0e0e0;
    }
    
    .form-control {
        background-color: #2a2a2a;
        color: #e0e0e0;
        border-color: #444;
    }
    
    .table {
        color: #e0e0e0;
    }
    
    .table-striped tbody tr:nth-of-type(odd) {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .form-control {
        min-height: 44px; /* Minimum touch target size */
    }
    
    input,
    select,
    textarea {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto !important;
        left: 10px !important;
        right: 10px;
        width: calc(100% - 20px);
    }
}

/* Landscape orientation */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        height: auto;
        min-height: 100vh;
    }
    
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .logo-text h1 {
        font-size: 1.2rem;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* Custom breakpoints for specific components */
@media (max-width: 850px) {
    .map-container {
        flex-direction: column;
    }
    
    .map-info,
    .map-placeholder {
        width: 100%;
    }
}

@media (max-width: 1100px) {
    .about-content {
        flex-direction: column;
    }
    
    .about-image,
    .about-text {
        width: 100%;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-transparency: reduce) {
    .hero-overlay,
    .modal-backdrop,
    .tooltip {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* Specific component responsive fixes */
@media (max-width: 767px) {
    /* Mobile navigation */
    .mobile-nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
    }
    
    .mobile-nav-toggle .toggle-bar {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--cream);
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    .mobile-nav-toggle.active .toggle-bar:nth-child(1) {
        transform: translateY(10px) rotate(45deg);
    }
    
    .mobile-nav-toggle.active .toggle-bar:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-nav-toggle.active .toggle-bar:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg);
    }
    
    /* Form steps */
    .form-step .step-header {
        margin-bottom: 20px;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    /* Tree visualization */
    #family-tree {
        transform: scale(0.8);
        transform-origin: top left;
    }
    
    /* Gallery grid */
    .gallery-item {
        aspect-ratio: 1/1;
    }
}

/* Loading states */
@media (prefers-reduced-motion: no-preference) {
    .loading-spinner {
        animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }
}