/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #fafafa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 16px 0;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.15);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.nav-brand h1 {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.nav-brand span {
    font-size: 14px;
    font-weight: 500;
    color: #bfdbfe;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: #bfdbfe;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 80px 0;
    text-align: center;
}

.hero h2 {
    font-size: 48px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero p {
    font-size: 20px;
    color: #64748b;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Container */
.search-container {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
}

/* Featured Section */
.featured-section {
    padding: 80px 0;
    background: white;
}

.featured-section h3 {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    color: #1e293b;
}

/* Categories Section */
.categories-section {
    padding: 80px 0;
    background: #f8fafc;
}

.categories-section > .container > h3 {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 64px;
    color: #1e293b;
}

.category-section {
    margin-bottom: 64px;
}

.category-section h4 {
    font-size: 24px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-width: 1000px;
    margin: 0 auto;
}

/* Calculator Cards */
.calculator-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: block;
    position: relative;
    overflow: hidden;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.calculator-card:hover::before {
    transform: scaleX(1);
}

.calculator-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.calculator-card.popular {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.calculator-card.popular::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 32px;
    margin-bottom: 16px;
    display: block;
}

.calculator-card h4,
.calculator-card h5 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.calculator-card p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.category-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.category-tag.forex {
    background: #dcfce7;
    color: #166534;
}

.category-tag.stock {
    background: #dbeafe;
    color: #1e40af;
}

.category-tag.options {
    background: #fef3c7;
    color: #92400e;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    padding: 64px 0 24px;
}

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

.footer-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

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

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

.footer-section a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 24px;
    text-align: center;
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 36px;
    }
    
    .hero p {
        font-size: 18px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        display: none;
    }
    
    .container {
        padding: 0 16px;
    }
}

/* Calculator Page Styles */
.calc-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 40px 0;
}

.calc-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.calc-description {
    font-size: 18px;
    color: #bfdbfe;
}

.calc-content {
    padding: 60px 0;
    background: white;
}

.calc-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.calc-btn {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.calc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
}

.result-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfccb 100%);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    display: none;
}

.result-section.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-value {
    font-size: 32px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 8px;
}

.result-label {
    color: #15803d;
    font-weight: 600;
}

.breadcrumb {
    padding: 16px 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.breadcrumb nav {
    font-size: 14px;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #6b7280;
    margin: 0 8px;
}

/* Hidden class for search */
.hidden {
    display: none !important;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animation for cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-card {
    animation: fadeInUp 0.6s ease forwards;
}

.calculator-card:nth-child(1) { animation-delay: 0.1s; }
.calculator-card:nth-child(2) { animation-delay: 0.2s; }
.calculator-card:nth-child(3) { animation-delay: 0.3s; }
.calculator-card:nth-child(4) { animation-delay: 0.4s; }
.calculator-card:nth-child(5) { animation-delay: 0.5s; }
.calculator-card:nth-child(6) { animation-delay: 0.6s; }