/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
    background: #f5f7fa;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 16px 80px; /* bottom padding for fixed nav */
    width: 100%;
}

/* ===== TOP NAVBAR – hidden on mobile ===== */
.navbar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 0.8rem 1rem;
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .navbar {
        display: none;
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 1.3rem;
}

.logo-img {
    height: 40px;
    width: auto;
}

.site-title {
    font-size: 1.2rem;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.nav-menu {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-menu li a {
    color: #e0e7ff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* ===== APP HEADER ===== */
.app-header {
    background: #ffffff;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.animate-header {
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-header h1 {
    font-size: 1.5rem;
    color: #1e3c72;
    margin: 0;
}

.app-header p {
    font-size: 0.9rem;
    color: #666;
    margin: 4px 0 0;
}

/* ===== SECTION TITLES ===== */
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e3c72;
    margin: 20px 0 10px;
}

/* ===== COLORFUL CARDS GRID – 3 per row on mobile, 4 on desktop ===== */
.converter-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 0; /* NO extra space below cards */
}

.card {
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    text-decoration: none;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100px;
}

.card:active {
    transform: scale(0.95);
}

.card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2), 0 6px 6px rgba(0,0,0,0.1);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 6px;
    line-height: 1;
}

.card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.3;
}

.card p {
    font-size: 0.7rem;
    margin: 0;
    line-height: 1.3;
    opacity: 0.9;
    display: none; /* hidden on mobile */
}

/* Tablet/Desktop */
@media (min-width: 768px) {
    .converter-cards {
        grid-template-columns: repeat(4, 1fr);
    }
    .card {
        padding: 20px;
        min-height: 150px;
    }
    .card h3 {
        font-size: 1.2rem;
    }
    .card p {
        display: block;
    }
    .card-icon {
        font-size: 2.5rem;
    }
}

/* Card color classes – all defined here */
.card-blue { background: #1e3c72; }
.card-green { background: #0f5132; }
.card-purple { background: #6f42c1; }
.card-orange { background: #f97316; }
.card-teal { background: #14b8a6; }
.card-pink { background: #ec4899; }

/* Legal tools colors */
.card-brown { background: #8B4513; }      /* UP Bhulekh */
.card-olive { background: #6B8E23; }      /* eCourts */
.card-navy { background: #2c3e50; }       /* UP Vaad */
.card-whatsapp { background: #25D366; }   /* WhatsApp */

/* ===== BOTTOM NAVIGATION – mobile only ===== */
.bottom-nav {
    display: none;
    justify-content: space-around;
    align-items: center;
    background: white;
    border-top: 1px solid #eaeef2;
    padding: 8px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #8a8f99;
    font-size: 0.7rem;
    flex: 1;
    transition: color 0.2s;
}

.nav-item.active {
    color: #1e3c72;
    font-weight: 500;
}

.nav-item:active {
    transform: scale(0.9);
}

.nav-icon {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

/* ===== LOGIN & REGISTER ===== */
.auth-container {
    max-width: 400px;
    margin: 30px auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 30px;
    animation: fadeIn 0.5s ease;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #1e3c72;
    font-size: 1.8rem;
}

.auth-form input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.3s, box-shadow 0.3s;
}

.auth-form input:focus {
    border-color: #1e3c72;
    box-shadow: 0 0 0 3px rgba(30,60,114,0.1);
    outline: none;
}

.auth-form button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-form button:active {
    transform: scale(0.98);
}

.auth-form button:hover {
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    box-shadow: 0 5px 15px rgba(30,60,114,0.4);
}

.error-message {
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 5px solid #b91c1c;
    font-weight: 500;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-footer a {
    color: #1e3c72;
    text-decoration: none;
    font-weight: 600;
}

/* ===== CONVERTER / SEARCH PAGES ===== */
.converter-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.back-button {
    display: inline-block;
    margin-bottom: 20px;
    color: #1e3c72;
    text-decoration: none;
    font-size: 1rem;
    padding: 5px 10px;
    border-radius: 30px;
    background: #e9ecef;
    transition: background 0.2s;
}

.back-button:active {
    background: #d6d9dc;
}

.search-form {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.search-form input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.search-form button {
    padding: 12px 20px;
    background: #1e3c72;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.search-form button:active {
    background: #2a5298;
    transform: scale(0.95);
}

.search-status {
    margin-bottom: 20px;
    font-weight: 600;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px;
    border-left: 6px solid #1e3c72;
    transition: transform 0.2s;
}

.result-card:active {
    transform: scale(0.99);
}

.result-card .card-header {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-weight: bold;
    flex-wrap: wrap;
}

.old-section {
    background: #dbeafe;
    padding: 4px 10px;
    border-radius: 20px;
    color: #1e3c72;
}

.new-section {
    background: #e0f2fe;
    padding: 4px 10px;
    border-radius: 20px;
    color: #0369a1;
}

.purpose {
    font-size: 1rem;
    margin-bottom: 8px;
}

.status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-change { background: #fef9c3; color: #854d0e; }
.status-deleted { background: #fee2e2; color: #b91c1c; }
.status-new { background: #dcfce7; color: #166534; }
.status-exact { background: #dbeafe; color: #1e40af; }

/* ===== PROFILE PAGE ===== */
.profile-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.profile-container h2 {
    color: #1e3c72;
    margin-bottom: 20px;
}

.profile-container p {
    margin: 10px 0;
}

.plan-free { color: #b45309; font-weight: 600; }
.plan-paid { color: #059669; font-weight: 600; }

/* ===== FULL-SCREEN AD MODAL ===== */
.ad-modal {
    display: flex;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.ad-modal-content {
    background-color: #fff;
    padding: 30px 20px 20px;
    border-radius: 15px;
    max-width: 95%;
    max-height: 95%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.ad-close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 10001;
    transition: color 0.3s;
    display: none; /* hidden by default */
}

.ad-close:hover {
    color: #333;
}

.ad-timer {
    text-align: center;
    margin-top: 10px;
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
    align-self: center;
}

.ad-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.ad-display img,
.ad-display video {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* ===== MAINTENANCE PAGE ===== */
.maintenance-container {
    text-align: center;
    padding: 50px 20px;
}

.maintenance-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

/* ===== UPDATE POPUP ===== */
.update-popup {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e3c72;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10001;
    animation: slideUp 0.3s ease;
}

.update-popup button,
.update-popup a {
    background: white;
    color: #1e3c72;
    border: none;
    padding: 6px 15px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

@keyframes slideUp {
    from { bottom: 0; opacity: 0; }
    to { bottom: 80px; opacity: 1; }
}

/* ===== VERSION INFO ===== */
.version-info {
    text-align: center;
    font-size: 0.7rem;
    color: #8a8f99;
    margin-top: 10px;
    padding-bottom: 5px;
}

/* ===== FLASH MESSAGES ===== */
.flash-message {
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    text-align: center;
    font-weight: 500;
    margin: 10px auto;
    max-width: 90%;
    animation: slideDown 0.3s ease, fadeOut 0.5s ease 4.5s forwards;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}