/* visual-hierarchy.css - Establishes proper visual hierarchy for website elements */

/* Typography Hierarchy */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a73e8;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #202124;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #202124;
}

p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #5f6368;
}

/* Navigation Spacing */
.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Add spacing between navigation items */
}

.nav-link {
    padding: 0.5rem 0.75rem;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.75rem;
    right: 0.75rem;
    height: 3px;
    background-color: #1a73e8;
    border-radius: 1.5px;
}

/* Card Hierarchy */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-primary {
    border-top: 4px solid #1a73e8;
}

.card-primary.card-accent {
    border-top: 4px solid #00b8d4;
}

/* Calculator Cards Grid Layout - MUCH WIDER COLUMNS WITH MINIMAL GAPS */
.featured-calculators .row {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0.5rem; /* Drastically reduced from 1rem for minimal space between columns */
    width: 100%;
    max-width: 100%;
    padding: 0 0.25rem; /* Reduced padding for better alignment */
}

/* Responsive Grid Layout */
@media (min-width: 576px) {
    .featured-calculators .row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem; /* Consistent minimal gap */
    }
}

@media (min-width: 768px) {
    .featured-calculators .row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem; /* Slightly larger but still small gap for medium screens */
    }
}

@media (min-width: 992px) {
    .featured-calculators .row {
        grid-template-columns: repeat(4, 1fr); /* Changed to 4 columns on larger screens */
        gap: 0.75rem; /* Consistent small gap */
    }
}

@media (min-width: 1200px) {
    .featured-calculators .row {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on very large screens */
        gap: 0.75rem; /* Consistent small gap */
    }
}

/* Popular Calculators Grid Layout - MUCH WIDER COLUMNS WITH MINIMAL GAPS */
.popular-calculators-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0.5rem; /* Drastically reduced from 1rem for minimal space between columns */
    width: 100%;
    max-width: 100%;
    padding: 0 0.25rem; /* Reduced padding for better alignment */
}

@media (min-width: 576px) {
    .popular-calculators-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem; /* Consistent minimal gap */
    }
}

@media (min-width: 768px) {
    .popular-calculators-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem; /* Slightly larger but still small gap for medium screens */
    }
}

@media (min-width: 992px) {
    .popular-calculators-grid {
        grid-template-columns: repeat(4, 1fr); /* Changed to 4 columns on larger screens */
        gap: 0.75rem; /* Consistent small gap */
    }
}

@media (min-width: 1200px) {
    .popular-calculators-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on very large screens */
        gap: 0.75rem; /* Consistent small gap */
    }
}

/* Visual Emphasis */
.calculator-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: rgba(26, 115, 232, 0.1);
    border-radius: 50%;
    margin-bottom: 1rem;
}

/* Calculator Card Styling */
.calculator-card {
    padding: 1rem; /* Further reduced padding to allow more content space */
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    overflow: visible; /* Changed from default overflow handling */
    width: 100%; /* Ensure cards take full width of their grid cell */
}

.calculator-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.calculator-card h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.3rem; /* Reduced from 1.5rem */
    white-space: normal; /* Ensure text wraps */
    overflow-wrap: break-word; /* Handle long words */
    word-break: normal;
}

.calculator-card p {
    flex-grow: 1;
    margin-bottom: 1.25rem;
    white-space: normal; /* Ensure text wraps */
    overflow-wrap: break-word; /* Handle long words */
}

.calculator-card .btn {
    align-self: flex-start;
}

/* Focus States */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Section Spacing */
section {
    padding: 3rem 0;
    margin-bottom: 2rem; /* Added margin between sections */
}

section.hero {
    padding: 4rem 0;
    margin-bottom: 3rem; /* Increased margin for hero section */
}

/* Category Sections */
.category-section {
    margin-bottom: 4rem !important; /* Increased from default */
    padding-bottom: 2rem;
    border-bottom: 1px solid #e8eaed;
}

/* Footer Hierarchy */
.footer-brand h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.footer-links {
    list-style: none;
    padding-left: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #e8eaed;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

/* Recently Used Calculators */
.recently-used-calculator {
    padding: 1.5rem;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.recently-used-calculator:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.recently-used-calculator h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.recently-used-calculator p {
    margin-bottom: 1rem;
}

.recently-used-calculator .timestamp {
    font-size: 0.875rem;
    color: #5f6368;
    margin-bottom: 1rem;
}

/* Dark Mode Adjustments */
.dark-mode h1, .dark-mode h2, .dark-mode h3 {
    color: #e8eaed;
}

.dark-mode p {
    color: #9aa0a6;
}

.dark-mode .card, 
.dark-mode .calculator-card, 
.dark-mode .recently-used-calculator {
    background-color: #202124;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.dark-mode .calculator-icon {
    background-color: rgba(26, 115, 232, 0.2);
}

.dark-mode a:focus, 
.dark-mode button:focus, 
.dark-mode input:focus, 
.dark-mode select:focus, 
.dark-mode textarea:focus {
    outline-color: #8ab4f8;
}

/* Container width adjustments for better space utilization */
.container {
    width: 100%;
    max-width: 1500px; /* Further increased from 1400px to allow more space */
    padding-left: 0.5rem; /* Reduced padding for wider content area */
    padding-right: 0.5rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1200px) {
    .container {
        padding-left: 1rem; /* Reduced from 2rem for wider content area */
        padding-right: 1rem;
    }
}
