/**
 * Tax Calculator Pakistan - Premium Stylesheet
 * Modern Glassmorphism Design with Animations
 */

/* ============================================
   CSS VARIABLES - PREMIUM THEME
   ============================================ */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

    /* Typography */
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

    --blur-sm: blur(8px);
    --blur-md: blur(16px);
    --blur-lg: blur(24px);

    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */
/* Mobile: Zero side padding for full responsiveness (Edge-to-Edge) */
@media (max-width: 767px) {

    .container,
    .container-fluid {
        padding-left: 3px !important;
        padding-right: 3px !important;
    }

    .main-content {
        padding-top: 0;
    }

    .calc-card {
        padding: 1.25rem 1rem !important;
        border-radius: 0 !important;
        margin-left: 0;
        margin-right: 0;
        border-left: none;
        border-right: none;
    }

    .hero-premium {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }
}

.hidden {
    display: none !important;
}


html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
}

/* ============================================
   PREMIUM NAVBAR (Visible, Less Transparent)
   ============================================ */
.premium-nav {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    padding: 0.75rem 0;
}

.premium-nav.scrolled {
    background: rgba(255, 255, 255, 1);
    box-shadow: var(--shadow-md);
}

.brand-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand-text {
    font-weight: 800;
    font-size: 1.25rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.premium-nav .nav-link {
    font-weight: 600;
    color: var(--dark);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    padding: 0.5rem 1rem !important;
}

.premium-nav .nav-link:hover,
.premium-nav .nav-link.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Dropdown Menu - Single Column, Visible */
.premium-dropdown {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    min-width: 220px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.premium-dropdown .dropdown-item {
    font-weight: 500;
    color: var(--dark);
    padding: 0.6rem 1.25rem;
    transition: var(--transition-fast);
}

.premium-dropdown .dropdown-item:hover,
.premium-dropdown .dropdown-item.active {
    background: var(--gradient-primary);
    color: white;
}

/* Mobile Dropdown Visibility */
@media (max-width: 991px) {
    .premium-dropdown {
        background: #f8fafc;
        border: none;
        box-shadow: none;
        margin-top: 0.5rem;
    }

    .premium-dropdown .dropdown-item {
        padding: 0.75rem 1rem;
        border-radius: var(--radius-sm);
    }
}

.ai-trigger-btn {
    background: var(--gradient-primary);
    border: none;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.ai-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   PREMIUM FOOTER
   ============================================ */
.premium-footer {
    background: var(--gradient-dark);
    color: white;
    position: relative;
    overflow: hidden;
}

.glass-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.footer-links {
    font-size: 0.9rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: white;
    padding-left: 4px;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.ai-promo-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

/* ============================================
   HERO SECTION - PREMIUM
   ============================================ */
.hero-premium {
    background: var(--gradient-dark);
    color: white;
    padding: 3rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 50%);
    pointer-events: none;
    animation: float 10s ease-in-out infinite;
}

.hero-premium::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -30%;
    width: 60%;
    height: 150%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 50%);
    pointer-events: none;
    animation: float 12s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, -20px);
    }
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 0;
}

/* ============================================
   CALCULATOR CARD - GLASS
   ============================================ */
.calc-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--blur-sm);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.calc-card-inner {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.input-premium {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.input-premium:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}

.btn-calculate {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 2rem;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: white;
}

/* ============================================
   RESULT CARD - PREMIUM
   ============================================ */
.result-premium {
    background: var(--gradient-success);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: white;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.result-value {
    font-size: 2rem;
    font-weight: 800;
}

.result-breakdown {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.result-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
}

.result-breakdown-item:last-child {
    border: none;
}

/* Result Boxes */
.result-box {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.result-box-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.85);
}

.result-box-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.result-box-value.text-danger {
    color: #fecaca !important;
}

.result-box-value.text-success {
    color: #bbf7d0 !important;
}

/* Quick Presets */
.quick-presets {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.35rem 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* ============================================
   TOOLS GRID - PREMIUM
   ============================================ */
.tools-section {
    padding: 4rem 0;
    background: white;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--secondary);
    font-size: 1rem;
}

.tool-card-premium {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tool-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: var(--transition);
}

.tool-card-premium:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    color: inherit;
}

.tool-card-premium:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.tool-card-premium h5 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.tool-card-premium p {
    color: var(--secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* ============================================
   BLOG CARDS - PREMIUM
   ============================================ */
.blog-section {
    padding: 4rem 0;
    background: var(--light);
}

.blog-card-premium {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
}

.blog-card-premium:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.blog-card-premium img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.blog-card-body {
    padding: 1.25rem;
}

.blog-card-premium h5 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.blog-card-premium h5 a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

.blog-card-premium h5 a:hover {
    color: var(--primary);
}

.blog-meta {
    font-size: 0.75rem;
    color: var(--secondary);
}

/* ============================================
   AI CHAT WIDGET - PREMIUM
   ============================================ */
.ai-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1050;
}

.ai-chat-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    cursor: pointer;
    transition: var(--transition);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: var(--shadow-lg), 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: var(--shadow-lg), 0 0 0 15px rgba(99, 102, 241, 0);
    }
}

.ai-chat-toggle:hover {
    transform: scale(1.1);
    animation: none;
}

.ai-chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.ai-chat-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-messages {
    height: 320px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
}

.ai-message {
    margin-bottom: 1rem;
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ai-message.bot {
    margin-right: auto;
}

.ai-message.user {
    margin-left: auto;
}

.ai-message p {
    background: white;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin: 0;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    line-height: 1.5;
}

.ai-message.user p {
    background: var(--primary);
    color: white;
}

.ai-chat-input {
    display: flex;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    gap: 0.75rem;
    background: white;
}

.ai-chat-input input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.ai-chat-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.ai-chat-input button {
    background: var(--primary);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.ai-chat-input button:hover {
    background: var(--primary-dark);
}

/* ============================================
   AI SUGGESTIONS PANEL
   ============================================ */
.ai-suggestions {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.ai-suggestions-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ai-suggestions-header i {
    color: var(--primary);
}

.ai-suggestions-header span {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
}

.ai-suggestion-text {
    font-size: 0.9rem;
    color: var(--dark);
    line-height: 1.6;
}

.ai-typing {
    display: inline-flex;
    gap: 4px;
}

.ai-typing span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.ai-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ============================================
   PREMIUM TABLES
   ============================================ */
.table-premium {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-premium .table {
    margin: 0;
}

.table-premium thead {
    background: var(--gradient-primary);
    color: white;
}

.table-premium th {
    font-weight: 600;
    padding: 1rem;
    border: none;
}

.table-premium td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

/* ============================================
   RESPONSIVE - MOBILE FIRST
   ============================================ */
@media (max-width: 991px) {
    .hero-title {
        font-size: 2rem;
    }

    .glass-dropdown {
        min-width: 100% !important;
        background: white;
    }

    .glass-dropdown .row {
        min-width: 100% !important;
    }
}

@media (max-width: 767px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-premium {
        padding: 2rem 0 3rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .calc-card {
        padding: 1.25rem;
        border-radius: var(--radius-lg);
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
    }

    .calc-card-inner {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .tools-section,
    .blog-section {
        padding: 2.5rem 0;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .ai-chat-box {
        width: calc(100vw - 32px);
        right: -8px;
    }

    .form-control,
    .form-select,
    .input-premium {
        font-size: 16px !important;
    }

    footer {
        text-align: center;
    }

    .footer-links {
        text-align: center;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.bg-gradient-success {
    background: var(--gradient-success) !important;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}