/* Home Page Specific Styles */
.welcome-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-light);
    text-align: center;
    transition: var(--transition);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.info-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--darker);
}

.info-card p {
    color: var(--gray);
    line-height: 1.6;
}

/* Calculator Types */
.calculator-types {
    margin-top: 3rem;
}

.calculator-types h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--darker);
    text-align: center;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.type-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-light);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.type-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.type-card:hover i {
    transform: scale(1.1);
}

.type-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.type-card h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--darker);
    text-align: center;
}

.type-card p {
    color: var(--gray);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.5;
}

.type-hint {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
    text-align: center;
}

/* Features Section */
.features-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-light);
}

.features-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--darker);
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-item {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-light);
    text-align: center;
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.feature-item i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--darker);
}

.feature-item p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Color coding for calculator types */
.type-card[href*="life"] i { color: #ef4444; }
.type-card[href*="health"] i { color: #10b981; }
.type-card[href*="car"] i { color: #3b82f6; }
.type-card[href*="bike"] i { color: #f59e0b; }
.type-card[href*="travel"] i { color: #8b5cf6; }

.type-card[href*="life"]:hover { border-color: #ef4444; }
.type-card[href*="health"]:hover { border-color: #10b981; }
.type-card[href*="car"]:hover { border-color: #3b82f6; }
.type-card[href*="bike"]:hover { border-color: #f59e0b; }
.type-card[href*="travel"]:hover { border-color: #8b5cf6; }

.type-card[href*="life"] .type-hint { background: #fee2e2; color: #991b1b; }
.type-card[href*="health"] .type-hint { background: #d1fae5; color: #065f46; }
.type-card[href*="car"] .type-hint { background: #dbeafe; color: #1e40af; }
.type-card[href*="bike"] .type-hint { background: #fef3c7; color: #92400e; }
.type-card[href*="travel"] .type-hint { background: #ede9fe; color: #5b21b6; }

/* Gradient backgrounds on hover */
.type-card[href*="life"]:hover { background: linear-gradient(135deg, #fff5f5 0%, white 100%); }
.type-card[href*="health"]:hover { background: linear-gradient(135deg, #f0fdf4 0%, white 100%); }
.type-card[href*="car"]:hover { background: linear-gradient(135deg, #eff6ff 0%, white 100%); }
.type-card[href*="bike"]:hover { background: linear-gradient(135deg, #fefce8 0%, white 100%); }
.type-card[href*="travel"]:hover { background: linear-gradient(135deg, #f5f3ff 0%, white 100%); }

/* Badge indicators */
.type-card::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.type-card:hover::after {
    opacity: 1;
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    white-space: nowrap;
    pointer-events: none;
}

/* Error message styles */
.error-message {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    padding: 1rem 1.2rem;
    margin: 1rem 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease;
}

.error-message i {
    color: #ef4444;
    font-size: 1.2rem;
}

.error-message span {
    color: #991b1b;
    font-size: 0.9rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Stats display */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--gray-light);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* How it works section */
.how-it-works {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-light);
}

.how-it-works h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--darker);
    text-align: center;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    counter-reset: step-counter;
}

.step {
    position: relative;
    padding-left: 60px;
}

.step::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.step h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--darker);
}

.step p {
    color: var(--gray);
    line-height: 1.6;
}

/* Call to action */
.cta-section {
    margin-top: 3rem;
    padding: 3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--border-radius);
    text-align: center;
    color: white;
}

.cta-section h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.cta-section p {
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background: white;
    color: var(--primary);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-section {
        grid-template-columns: 1fr;
    }
    
    .type-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .type-card {
        min-height: 220px;
        padding: 1.5rem;
    }
    
    .info-card, .feature-item {
        padding: 1.25rem;
    }
    
    .cta-section {
        padding: 2rem 1.5rem;
    }
    
    .steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .step {
        padding-left: 50px;
    }
    
    .step::before {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .type-card {
        min-height: 200px;
        padding: 1.25rem;
    }
    
    .type-card i {
        font-size: 2.5rem;
    }
    
    .type-card h4 {
        font-size: 1.2rem;
    }
    
    .type-hint {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
    
    .info-card i, .feature-item i {
        font-size: 2rem;
    }
    
    .info-card h3, .feature-item h4 {
        font-size: 1.1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .info-card,
    .type-card,
    .feature-item,
    .stat-card {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .info-card h3,
    .type-card h4,
    .feature-item h4,
    .stat-label {
        color: #e2e8f0;
    }
    
    .info-card p,
    .type-card p,
    .feature-item p,
    .step p {
        color: #a0aec0;
    }
    
    .type-hint {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .error-message {
        background: #4a1e1e;
        border-left-color: #fc8181;
    }
    
    .error-message span {
        color: #fed7d7;
    }
}

/* Print styles */
@media print {
    .type-card:hover,
    .info-card:hover,
    .feature-item:hover {
        transform: none;
        box-shadow: none;
    }
    
    .type-card::after,
    .tooltip,
    .cta-section {
        display: none;
    }
}