/* Enhanced Mobile Responsiveness - Admin Dashboard Style */

/* Improved Mobile Navigation */
@media (max-width: 768px) {
    .navbar {
        padding: 0.8rem 0;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: rgba(255, 248, 240, 0.98);
        backdrop-filter: blur(15px);
        box-shadow: 0 2px 20px rgba(139, 69, 19, 0.1);
    }
    
    .navbar .container {
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1.6rem;
        z-index: 1001;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        cursor: pointer;
        padding: 0.5rem;
        z-index: 1001;
        border: none;
        background: none;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(139, 69, 19, 0.1);
        border-radius: 8px;
    }
    
    .mobile-menu-toggle span {
        width: 28px;
        height: 3px;
        background: #8b4513;
        margin: 3px 0;
        transition: all 0.3s ease;
        border-radius: 3px;
        transform-origin: center;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
        background: #d32f2f;
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
        background: #d32f2f;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: rgba(255, 248, 240, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 80px 2rem 2rem 2rem;
        gap: 0;
        margin: 0;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        box-shadow: -5px 0 25px rgba(139, 69, 19, 0.1);
        border-left: 1px solid rgba(139, 69, 19, 0.1);
        z-index: 1000;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
        margin: 0;
    }
    
    .nav-links a {
        display: block;
        width: 100%;
        padding: 1rem 1.5rem;
        margin: 0.5rem 0;
        border-radius: 12px;
        text-align: left;
        font-size: 1.1rem;
        font-weight: 600;
        color: #3d2914;
        transition: all 0.3s ease;
        border: 2px solid transparent;
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(160, 82, 45, 0.1) 100%);
        border-color: rgba(139, 69, 19, 0.2);
        transform: translateX(5px);
        color: #8b4513;
    }
    
    /* Overlay for mobile menu */
    .nav-links.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
        animation: fadeIn 0.3s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

/* Enhanced Container Responsiveness */
@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 0.5rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* Improved section spacing */
    .kabi-parichaya-box,
    .poems-header-box {
        margin: 1rem 0;
        padding: 1.5rem 1rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
}

/* Tablet Optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        width: 90%;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    .nav-links a {
        padding: 0.4rem 0.8rem;
        font-size: 0.95rem;
    }
}

/* Footer Responsiveness */
@media (max-width: 768px) {
    footer .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: 1.5rem;
    }
    
    .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .footer-links li {
        margin: 0;
    }
}

/* Enhanced Card Responsiveness */
@media (max-width: 768px) {
    .poem-cards {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        padding: 1rem 0;
    }
    
    .poem-card {
        max-width: 400px;
        margin: 0 auto;
        height: auto !important;
        min-height: 350px;
    }
}

@media (max-width: 480px) {
    .poem-card {
        min-height: 320px;
    }
    
    .poem-card .poem-content {
        padding: 1rem;
    }
    
    .poem-card .poem-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .poem-card .poem-excerpt {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .poem-card .poem-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Smooth Animations */
* {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Loading States */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #8b4513;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(139, 69, 19, 0.1);
    border-left: 4px solid #8b4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.error-message {
    background: rgba(211, 47, 47, 0.1);
    border: 1px solid rgba(211, 47, 47, 0.3);
    color: #d32f2f;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

/* Success States */
.success-message {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4caf50;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States for Accessibility */
button:focus,
a:focus,
input:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid #8b4513;
    outline-offset: 2px;
    border-radius: 4px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .navbar {
        background: white;
        border-bottom: 2px solid #000;
    }
    
    .nav-links a {
        color: #000;
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        background: #000;
        color: #fff;
    }
}
