/* Calculator Dekho - Enhanced Professional Design */
:root {
    /* Psychology-driven color palette for engagement and trust */
    --primary-color: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --secondary-color: #64748b;
    --accent-color: #059669;
    --accent-light: #10b981;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    
    /* Neutral colors for balance */
    --light-color: #f8fafc;
    --lighter-color: #f1f5f9;
    --dark-color: #0f172a;
    --darker-color: #020617;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Text colors for optimal readability */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* Shadows for depth */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border radius for consistency */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #ffffff;
    font-size: 16px;
    margin: 0;
    padding: 0;
    font-weight: 400;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.75rem; font-weight: 600; }
h4 { font-size: 1.5rem; font-weight: 600; }
h5 { font-size: 1.25rem; font-weight: 600; }
h6 { font-size: 1.125rem; font-weight: 600; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Header Styles */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 0;
    position: relative;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover {
    color: #f1f5f9 !important;
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

.navbar-brand i {
    font-size: 1.75rem;
    color: #93c5fd;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.9) !important;
    border-radius: var(--radius-sm);
}

.nav-link:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    background: white;
}

.dropdown-item {
    padding: 0.75rem 1.25rem;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: var(--lighter-color);
    color: var(--primary-color);
    transform: translateX(4px);
}

.dropdown-item i {
    color: var(--primary-light);
    width: 20px;
}

/* Header Ad Container - Centered */
.ad-container.ad-top-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: var(--space-lg) auto;
    max-width: 728px;
    min-height: 90px;
    background: var(--lighter-color);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Hero Section - Improved Contrast */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.2;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 600px;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-bottom: none;
    padding: 1rem 1.5rem;
    color: white;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.card-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Tool Cards */
.tool-card {
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    height: 100%;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tool-card .card-body {
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 140px;
}

.tool-card i {
    margin-bottom: 1rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.tool-card:hover i {
    transform: scale(1.1);
    color: var(--primary-dark);
}

.tool-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* All Calculator Categories Section */
.calculator-categories {
    background: var(--light-color);
    padding: var(--space-2xl) 0;
}

.categories-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: white;
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
}

.category-section {
    margin-bottom: var(--space-2xl);
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--border-light);
}

.category-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--lighter-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-lg);
    border: 3px solid var(--border-color);
}

.category-icon i {
    font-size: 2rem;
    color: var(--primary-color);
}

.category-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.calculator-link {
    display: block;
    padding: var(--space-md);
    color: var(--primary-light);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

.calculator-link:hover {
    background: var(--lighter-color);
    color: var(--primary-dark);
    text-decoration: none;
    border-color: var(--border-color);
    transform: translateX(4px);
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-light {
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.btn-light:hover {
    background: var(--lighter-color);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-light {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.btn-outline-light:hover {
    background: white;
    color: var(--primary-color);
    border-color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), var(--accent-color));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--success-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

/* Calculator Form Styles */
.calculator-form {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}

.form-control:hover {
    border-color: var(--primary-light);
}

/* Result Display */
.result-display {
    background: linear-gradient(135deg, var(--lighter-color), #ffffff);
    padding: 2rem;
    border-radius: var(--radius-xl);
    margin-top: 2rem;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

.result-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

/* Search Section */
.search-section {
    background: var(--light-color);
    padding: 3rem 0;
}

.search-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 2rem;
}

.search-input {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}

/* Section Styles */
.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Advertisement Spaces */
.ad-container {
    text-align: center;
    margin: 2rem auto;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.ad-middle-banner, .ad-bottom-banner {
    max-width: 728px;
    min-height: 90px;
    background: var(--lighter-color);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.ad-sidebar {
    max-width: 300px;
    min-height: 600px;
    background: var(--lighter-color);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: var(--lighter-color);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Related Calculators */
.related-calculators .card {
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.related-calculators .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.related-calculators .card-body {
    padding: 1.5rem;
}

.related-calculators h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.related-calculators p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Footer Styles */
.site-footer {
    background: linear-gradient(135deg, var(--dark-color), var(--darker-color));
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.site-footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.site-footer a:hover {
    color: white;
    transform: translateX(4px);
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: 0.75rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

#back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* Loading States */
.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error and Success Messages */
.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.success-message {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Tables */
.table {
    border-collapse: collapse;
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border: none;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.table tr:hover {
    background-color: var(--lighter-color);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.875rem;
        margin-bottom: 2rem;
    }
    
    .calculator-form {
        padding: 1.5rem;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .ad-top-banner, .ad-middle-banner, .ad-bottom-banner {
        max-width: 100%;
        min-height: 250px;
    }
    
    .ad-sidebar {
        max-width: 100%;
        min-height: 250px;
    }
    
    #back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .category-header {
        flex-direction: column;
        text-align: center;
    }
    
    .category-icon {
        margin-right: 0;
        margin-bottom: var(--space-md);
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .search-input {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
    
    .categories-container {
        padding: var(--space-lg);
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.shadow-custom {
    box-shadow: var(--shadow-lg);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, var(--primary-color), var(--primary-light)) 1;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.6s ease-in-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .navbar,
    .site-footer,
    .ad-container,
    #back-to-top {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* Calculator Categories Design */
.calculator-categories-container {
    max-width: 100%;
}

.category-section {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    background: var(--card-bg);
    transition: all 0.3s ease;
}

.category-section:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.category-header {
    margin-bottom: 1.5rem;
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(var(--primary-rgb), 0.1);
}

.category-count .badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

.calculator-grid {
    margin-bottom: 1.5rem;
}

.calculator-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.calculator-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    transition: all 0.3s ease;
    text-align: center;
    height: 100px;
    min-height: 100px;
}

.calculator-item:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.calculator-item i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.calculator-item span {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    transition: all 0.3s ease;
}

.calculator-item:hover i,
.calculator-item:hover span {
    color: white;
}

/* Responsive adjustments for calculator grid */
@media (max-width: 768px) {
    .category-section {
        padding: 1.5rem;
    }
    
    .calculator-item {
        padding: 1rem 0.5rem;
        height: 90px;
        min-height: 90px;
    }
    
    .calculator-item i {
        font-size: 1.25rem;
    }
    
    .calculator-item span {
        font-size: 0.8rem;
    }
    
    .category-icon {
        width: 50px;
        height: 50px;
    }
    
    .category-icon i {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 576px) {
    .calculator-item {
        height: 80px;
        min-height: 80px;
        padding: 0.75rem 0.25rem;
    }
    
    .calculator-item span {
        font-size: 0.75rem;
    }
}

/* Category-specific colors */
.category-section:nth-child(1) .category-icon {
    background: rgba(13, 110, 253, 0.1);
}

.category-section:nth-child(2) .category-icon {
    background: rgba(25, 135, 84, 0.1);
}

.category-section:nth-child(3) .category-icon {
    background: rgba(13, 202, 240, 0.1);
}

.category-section:nth-child(4) .category-icon {
    background: rgba(255, 193, 7, 0.1);
}
