/* ============================================
   Haqeeqat.pk - Surraiya Encyclopaedia of Quran
   Mobile Responsive CSS
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
.header, header {
    background: linear-gradient(135deg, #1a472a, #0d2818);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1, header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.header p, header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Navigation */
.nav, nav {
    background: #2d5a3b;
    padding: 12px;
    text-align: center;
    overflow-x: auto;
    white-space: nowrap;
}

.nav a, nav a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    display: inline-block;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.nav a:hover, nav a:hover {
    background: #1a472a;
    border-radius: 20px;
}

/* Main Container */
.container, .main-container, .wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Content Sections */
.content, .main-content, section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Headings */
h1 {
    font-size: 2rem;
    color: #1a472a;
    margin-bottom: 15px;
}

h2 {
    font-size: 1.5rem;
    color: #1a472a;
    margin-bottom: 12px;
}

h3 {
    font-size: 1.2rem;
    color: #2d5a3b;
    margin-bottom: 10px;
}

/* Paragraphs */
p {
    margin-bottom: 12px;
    font-size: 1rem;
}

/* Links */
a {
    color: #2d5a3b;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Cards Grid */
.cards, .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    color: #1a472a;
    margin-bottom: 12px;
}

.card p {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.card a {
    color: #2d5a3b;
    font-weight: bold;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    overflow-x: auto;
    display: block;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background: #1a472a;
    color: white;
}

tr:nth-child(even) {
    background: #f2f2f2;
}

/* Lists */
ul, ol {
    margin: 10px 0 10px 25px;
}

li {
    margin: 5px 0;
}

/* Footer */
.footer, footer {
    background: #1a472a;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    font-size: 0.8rem;
}

/* Buttons */
button, .btn {
    background: #2d5a3b;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
}

button:hover, .btn:hover {
    background: #1a472a;
}

/* Forms */
input, select, textarea {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

/* ============================================
   MOBILE RESPONSIVE (Important for your issue)
   ============================================ */

/* Tablet and Mobile */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    .header h1, header h1 {
        font-size: 1.3rem;
    }
    
    .header p, header p {
        font-size: 0.75rem;
    }
    
    .nav a, nav a {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .container, .main-container, .wrapper {
        padding: 12px;
    }
    
    .content, .main-content, section {
        padding: 15px;
    }
    
    .cards, .grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .card h3 {
        font-size: 1rem;
    }
    
    .card p {
        font-size: 0.8rem;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 5px;
    }
}

/* Small Mobile (phones below 480px) */
@media (max-width: 480px) {
    .header, header {
        padding: 15px;
    }
    
    .nav, nav {
        padding: 8px;
    }
    
    .nav a, nav a {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
    
    .container {
        padding: 10px;
    }
    
    p {
        font-size: 0.85rem;
    }
}

/* Make sure all content is visible */
body, html {
    height: auto;
    min-height: 100vh;
}

.container, .main, .content, .wrapper, [class*="content"], [class*="main"] {
    display: block;
    visibility: visible;
}

/* Fix for any hidden elements */
.hidden, .hide {
    display: block !important;
}

/* Print Styles */
@media print {
    .nav, nav, .footer, footer {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}