/* =================================================================
   APARNA & ASSOCIATES - MAIN STYLESHEET
   Professional Company Secretary Services Website
   ================================================================= */

/* === CSS VARIABLES === */
:root {
    --primary-color: #0f172a;
    --secondary-color: #1e293b;
    --accent-color: #f59e0b;
    --gold: #fbbf24;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--white);
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === CONTAINER === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === HEADER === */
.top-bar {
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 0;
    font-size: 14px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.top-bar-left {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--white);
}

.contact-item i {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.social-icon {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 16px;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* === MAIN HEADER === */
.main-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 60px;
    height: 60px;
}

.logo-text h1 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.logo-text p {
    font-size: 13px;
    color: var(--text-light);
}

/* === NAVIGATION === */
.main-nav > ul {
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav a {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
    padding: 10px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

/* Dropdown Menu - VERTICAL LAYOUT */
.menu-item-has-children {
    position: relative;
}

.menu-item-has-children > a::after {
    content: '▼';
    font-size: 9px;
    margin-left: 6px;
    transition: transform 0.3s ease;
}

.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;

    width: 600px;          /* fixed safe width */
    max-width: calc(100vw - 40px);  /* never overflow screen */

    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    border-top: 4px solid var(--accent-color);

    box-shadow: var(--shadow-xl);

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s ease;

    z-index: 1000;
}

    /* ❌ REMOVE SCROLL */
    max-height: none;
    overflow: visible;
}

/* Custom scrollbar for dropdown */
.sub-menu::-webkit-scrollbar {
    width: 6px;
}

.sub-menu::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.sub-menu::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.menu-item-has-children:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu li {
    width: 100%;
    border: none;
}

.sub-menu li:last-child {
    border-bottom: none;
}

.sub-menu a {
    display: block;
    padding: 14px;
    background: var(--bg-light);
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    transition: 0.3s;
}

.sub-menu a:hover {
    background: var(--accent-color);
    color: white;
}

.sub-menu a:before {
    content: '→';
    margin-right: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sub-menu a:hover:before {
    opacity: 1;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
}

/* === HERO SECTION === */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary-color);
}

/* === PAGE TITLE === */
.page-title {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.page-title h1 {
    font-size: 42px;
    margin-bottom: 10px;
}

.page-title p {
    font-size: 18px;
    opacity: 0.9;
}

/* === MAIN CONTENT === */
.main-content {
    padding: 60px 0;
}

.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

/* === SERVICE CARDS === */
.service-card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 3rem 0;
    justify-content: flex-start;
}

.service-card-item {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    border-top: 4px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 1 1 calc(50% - 1rem);
    min-width: 320px;
    max-width: calc(50% - 1rem);
}

.service-card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
}

.service-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-color), var(--gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.service-benefits {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1.5rem 0;
}

.service-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-benefits li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-light);
}

.service-benefits li:last-child {
    border-bottom: none;
}

.service-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.service-link:hover {
    background: var(--primary-color);
}

/* === FEATURE BOXES === */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-box {
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
}

.feature-box i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-box h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.feature-box p {
    color: var(--text-light);
    line-height: 1.7;
}

/* === CONTACT FORM === */
.contact-form {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 15px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* === FOOTER === */
.main-footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* === WHATSAPP BUTTON === */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.4);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .service-card-item {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .top-bar-content {
        flex-direction: column;
        text-align: center;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-nav li {
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-nav a {
        display: block;
        padding: 15px 20px;
    }
    
    .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-top: none;
        background: var(--bg-light);
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .page-title h1 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 25px;
        bottom: 20px;
        right: 20px;
    }
}
.menu-item-has-children:last-child .sub-menu {
    left: auto;
    right: 0;
    transform: none;
}
html, body {
    overflow-x: hidden;
}
/* =========================
   FINAL MEGA MENU FIX
   ========================= */

/* reset any broken behavior */
.sub-menu {
    all: unset;
}

/* rebuild dropdown clean */
.menu-item-has-children {
    position: relative;
}

.menu-item-has-children .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;

    width: 600px;
    max-width: calc(100vw - 40px);

    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border-top: 4px solid #f59e0b;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;

    box-shadow: 0 20px 40px rgba(0,0,0,0.15);

    opacity: 0;
    visibility: hidden;
    transition: 0.3s;

    z-index: 9999;
}

/* show dropdown */
.menu-item-has-children:hover .sub-menu {
    opacity: 1;
    visibility: visible;
}

/* fix items */
.sub-menu li {
    list-style: none;
}

.sub-menu a {
    display: block;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    text-align: center;
}

.sub-menu a:hover {
    background: #6366f1;
    color: white;
}

/* 🔥 IMPORTANT: last menu opens LEFT */
.menu-item-has-children:last-child .sub-menu {
    left: auto;
    right: 0;
}
/* 🔥 LICENSE DROPDOWN (SEPARATE CLEAN SYSTEM) */

.license-menu {
    position: relative;
}

/* dropdown box */
.license-dropdown {
    position: absolute;
    top: 100%;
    right: 0;   /* 🔥 always open left */

    width: 500px;
    max-width: calc(100vw - 40px);

    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;

    opacity: 0;
    visibility: hidden;
    transition: 0.3s;

    z-index: 9999;
}

/* show */
.license-menu:hover .license-dropdown {
    opacity: 1;
    visibility: visible;
}

/* items */
.license-dropdown a {
    display: block;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    text-align: center;
}

.license-dropdown a:hover {
    background: #6366f1;
    color: white;
}
/* remove horizontal scroll */
html, body {
    overflow-x: hidden;
}
/* 🔥 FORCE LICENSE MENU TO OPEN LEFT */
.license-menu .sub-menu {
    left: auto;
    right: 0;
}
.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav li {
    list-style: none;
}
