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

:root {
    /* Light theme colors */
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 221.2 83.2% 53.3%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96%;
    --secondary-foreground: 222.2 84% 4.9%;
    --muted: 210 40% 96%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96%;
    --accent-foreground: 222.2 84% 4.9%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 221.2 83.2% 53.3%;
    --radius: 0.5rem; /* Tighter border radius */
    
    /* Standardized Spacing - Tighter */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem; /* Reduced from 1rem */
    --spacing-lg: 1rem; /* Reduced from 1.5rem */
    --spacing-xl: 1.5rem; /* Reduced from 2rem */
    --spacing-2xl: 2rem; /* Reduced from 3rem */
    --spacing-3xl: 3rem; /* Reduced from 4rem */
    
    /* Standardized Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    
    /* Component specific colors */
    --coin-heads: 45 93% 47%;
    --coin-heads-border: 45 100% 35%;
    --coin-tails: 14 91% 43%;
    --coin-tails-border: 14 100% 30%;
    --success: 142 76% 36%;
    --success-foreground: 210 40% 98%;
    --warning: 38 92% 50%;
    --warning-foreground: 222.2 84% 4.9%;
    
    /* Gradient backgrounds */
    --bg-gradient: linear-gradient(135deg, hsl(var(--background)) 0%, hsl(210 40% 98%) 100%);
    --card-gradient: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--card)) 100%);
    
    /* Animation timings */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Modern Shadows - Subtle and Sharp */
    --shadow-sm: 0 1px 2px 0 hsl(var(--foreground) / 0.04);
    --shadow-md: 0 2px 4px -1px hsl(var(--foreground) / 0.06), 0 1px 2px -1px hsl(var(--foreground) / 0.04);
    --shadow-lg: 0 4px 8px -2px hsl(var(--foreground) / 0.08), 0 2px 4px -2px hsl(var(--foreground) / 0.06);
    --shadow-xl: 0 8px 16px -4px hsl(var(--foreground) / 0.1), 0 4px 8px -4px hsl(var(--foreground) / 0.08);
}

[data-theme="dark"] {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 217.2 91.2% 59.8%;
    --primary-foreground: 222.2 84% 4.9%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 224.3 76.3% 94.1%;
    
    /* Dark theme gradients */
    --bg-gradient: linear-gradient(135deg, hsl(var(--background)) 0%, hsl(217.2 32.6% 17.5%) 100%);
    --card-gradient: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(217.2 32.6% 19.5%) 100%);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --background: 222.2 84% 4.9%;
        --foreground: 210 40% 98%;
        --card: 222.2 84% 4.9%;
        --card-foreground: 210 40% 98%;
        --popover: 222.2 84% 4.9%;
        --popover-foreground: 210 40% 98%;
        --primary: 217.2 91.2% 59.8%;
        --primary-foreground: 222.2 84% 4.9%;
        --secondary: 217.2 32.6% 17.5%;
        --secondary-foreground: 210 40% 98%;
        --muted: 217.2 32.6% 17.5%;
        --muted-foreground: 215 20.2% 65.1%;
        --accent: 217.2 32.6% 17.5%;
        --accent-foreground: 210 40% 98%;
        --destructive: 0 62.8% 30.6%;
        --destructive-foreground: 210 40% 98%;
        --border: 217.2 32.6% 17.5%;
        --input: 217.2 32.6% 17.5%;
        --ring: 224.3 76.3% 94.1%;
        
        /* Dark theme gradients */
        --bg-gradient: linear-gradient(135deg, hsl(var(--background)) 0%, hsl(217.2 32.6% 17.5%) 100%);
        --card-gradient: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(217.2 32.6% 19.5%) 100%);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: hsl(var(--foreground));
    background: var(--bg-gradient);
    min-height: 100vh;
    font-feature-settings: "rlig" 1, "calt" 1;
    transition: color 0.3s ease, background 0.3s ease;
}

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

/* Desktop margins for better spacing */
@media (min-width: 768px) {
    .container {
        padding: 0 40px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 60px;
    }
}

/* Header and Navigation */
header {
    background: hsl(var(--card) / 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid hsl(var(--border));
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    vertical-align: middle;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.theme-toggle {
    background: hsl(var(--secondary));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--secondary-foreground));
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.theme-toggle:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.theme-icon {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.nav-link {
    text-decoration: none;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.nav-link:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.nav-link.active {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

/* Main Content */
main {
    padding: 1rem 0;
}

/* Modern section styles */
.main-section {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    margin: 1rem 20px;
    padding: var(--spacing-2xl) var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.2s ease;
}

/* Add responsive margins for main sections */
@media (min-width: 768px) {
    .main-section {
        margin: 1rem 40px;
    }
}

@media (min-width: 1024px) {
    .main-section {
        margin: 1rem auto;
        max-width: calc(1200px + 120px); /* container max-width + extra margin */
    }
}

/* Update coin-flipper-section to match main-section margins */
.coin-flipper-section {
    margin: 1rem 20px;
}

@media (min-width: 768px) {
    .coin-flipper-section {
        margin: 1rem 40px;
    }
}

@media (min-width: 1024px) {
    .coin-flipper-section {
        margin: 1rem auto;
        max-width: calc(1200px + 120px);
    }
}

/* Standardized Tool Layout System */
.tool-layout {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    margin: var(--spacing-2xl) 0;
    min-height: 500px; /* Ensure consistent minimum height */
}

/* Desktop horizontal layout for all tools */
@media (min-width: 1024px) {
    .tool-layout {
        display: grid;
        grid-template-columns: 1fr 420px;
        gap: var(--spacing-2xl);
        align-items: start; /* Changed from center to start for consistent top alignment */
        max-width: 1200px;
        margin: var(--spacing-2xl) auto;
        min-height: 600px; /* Larger minimum height for desktop */
    }
    
    .tool-display {
        margin: 0;
        justify-self: center;
        align-self: start; /* Changed to start for consistent top alignment */
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-lg);
        padding-top: var(--spacing-lg); /* Consistent top padding */
    }
    
    .tool-controls {
        margin: 0;
        max-width: none;
        align-self: start; /* Changed to start for consistent top alignment */
        height: fit-content;
        padding-top: var(--spacing-lg); /* Match tool-display top padding */
    }
}

/* Standardized Main Interactive Element */
.main-interactive-element {
    width: 280px;
    height: 280px;
    margin: 0 auto var(--spacing-md) auto; /* Tighter margin */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Modern Action Button */
.main-action-button {
    margin: var(--spacing-md) 0; /* Tighter margins */
}

/* Modern Result Display */
.main-result {
    margin: var(--spacing-md) 0;
    min-height: 2.5rem; /* Slightly smaller minimum height */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Responsive Design for all tools */
@media (max-width: 1023px) {
    .tool-layout {
        display: block !important;
    }
    
    .tool-display {
        margin: 2rem 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.5rem !important;
    }
    
    .tool-controls {
        margin: 2rem auto !important;
        max-width: 600px !important;
    }
}

/* Common tool controls styling */
/* Modern Tool Controls */
.tool-controls {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
}

@media (max-width: 768px) {
    .tool-controls {
        padding: var(--spacing-lg);
    }
}

/* Reusable Form Components */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-row {
    display: grid;
    gap: var(--spacing-md);
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.input-field {
    padding: 0.75rem 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: var(--font-size-base);
    transition: var(--transition-normal);
}

.input-field:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

.input-field:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.label {
    font-weight: 500;
    color: hsl(var(--foreground));
    font-size: var(--font-size-sm);
}

/* Standardized Button Components */
.btn {
    padding: 0.6rem 1.2rem; /* Tighter padding */
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-normal);
    font-weight: 500; /* Slightly lighter weight */
    font-size: var(--font-size-sm);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    letter-spacing: 0.01em; /* Subtle letter spacing */
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: hsl(var(--primary) / 0.9);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: 1px solid hsl(var(--border));
}

.btn-secondary:hover:not(:disabled) {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-destructive {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover:not(:disabled) {
    background: hsl(var(--destructive) / 0.9);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 0.8rem 2rem; /* More conservative padding */
    font-size: var(--font-size-lg);
    border-radius: var(--radius);
    font-weight: 600; /* Keep stronger weight for primary buttons */
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-xs);
    border-radius: calc(var(--radius) * 0.8);
}

/* Common title styles */
.main-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: hsl(var(--foreground));
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.8));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 1.125rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Modern Coin Animation */
.coin-container {
    perspective: 1200px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15)); /* Subtler shadow */
}

.coin {
    width: 280px; /* Standardized to match other tools */
    height: 280px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600; /* Slightly lighter */
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); /* Cleaner text shadow */
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2), /* Reduced shadow intensity */
        inset 0 1px 2px rgba(255, 255, 255, 0.15),
        inset 0 -1px 2px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    backface-visibility: hidden;
}

.heads {
    background: 
        radial-gradient(circle at 30% 30%, hsl(var(--coin-heads) / 0.9), hsl(var(--coin-heads))),
        linear-gradient(135deg, hsl(var(--coin-heads)), hsl(var(--coin-heads) / 0.7));
    border: 6px solid hsl(var(--coin-heads-border));
    transform: rotateY(0deg);
}

.heads span {
    transform: rotateY(0deg);
}

.tails {
    background: 
        radial-gradient(circle at 30% 30%, hsl(var(--coin-tails) / 0.9), hsl(var(--coin-tails))),
        linear-gradient(135deg, hsl(var(--coin-tails)), hsl(var(--coin-tails) / 0.7));
    border: 6px solid hsl(var(--coin-tails-border));
    transform: rotateY(180deg);
}

.tails span {
    transform: rotateY(180deg) scaleX(-1);
}

/* History section styling within tool-controls */
.tool-controls .history-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid hsl(var(--border));
}

.flip-button {
    margin-bottom: var(--spacing-xl);
}

.result {
    font-size: 1.5rem;
    font-weight: 700;
    min-height: 2rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
    color: hsl(var(--foreground));
}

.result.heads-result {
    color: hsl(var(--coin-heads));
    text-shadow: 0 2px 4px hsl(var(--coin-heads) / 0.3);
}

.result.tails-result {
    color: hsl(var(--coin-tails));
    text-shadow: 0 2px 4px hsl(var(--coin-tails) / 0.3);
}

.result-animation {
    animation: resultPop 0.6s ease;
}

@keyframes resultPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Modern Statistics */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-md);
    max-width: 500px;
    margin: var(--spacing-xl) auto;
    padding: var(--spacing-lg);
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-md);
    background: hsl(var(--muted) / 0.4);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    border: 1px solid hsl(var(--border) / 0.3);
}

.stat-item:hover {
    background: hsl(var(--muted) / 0.6);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    display: block;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}

.reset-button {
    grid-column: 1 / -1;
    margin-top: var(--spacing-sm);
}

/* History Section */
.history-section {
    margin-top: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.toggle-history-btn {
    width: 100%;
    margin-bottom: var(--spacing-md);
}

.history-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
}

.history-container.active {
    max-height: 400px;
    overflow-y: auto;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
    background: hsl(var(--muted) / 0.3);
}

.history-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: 0;
}

.clear-history-btn {
    /* Styles handled by .btn-destructive .btn-small */
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
}

.no-history {
    color: hsl(var(--muted-foreground));
    text-align: center;
    margin: 0;
    padding: 2rem 1rem;
    font-style: italic;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: calc(var(--radius) * 0.8);
    margin-bottom: 0.5rem;
    background: hsl(var(--muted) / 0.3);
    transition: all 0.2s ease;
}

.history-item:hover {
    background: hsl(var(--muted) / 0.5);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-result {
    font-weight: 600;
    font-size: 0.9rem;
}

.history-result.heads {
    color: hsl(var(--coin-heads));
}

.history-result.tails {
    color: hsl(var(--coin-tails));
}

.history-time {
    color: hsl(var(--muted-foreground));
    font-size: 0.75rem;
}

/* Features Section - specific overrides only */
.features-section {
    padding: 3rem 1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: var(--spacing-lg); /* Use standardized spacing */
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    transform: translateY(-1px); /* Subtler hover effect */
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: hsl(var(--muted-foreground));
    line-height: 1.5;
}

/* How It Works Section - specific overrides only */
.how-it-works-section {
    padding: 3rem 1rem;
}

.how-it-works-section h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin-bottom: 2rem;
    letter-spacing: -0.025em;
}

.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.step-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
    position: relative;
    transition: all 0.2s ease;
}

.step-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px hsl(var(--foreground) / 0.1);
}

.step-number {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.step-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}

.step-card p {
    color: hsl(var(--muted-foreground));
    line-height: 1.5;
}

/* Use Cases Section - specific overrides only */
.use-cases-section {
    padding: 3rem 1rem;
}

.use-cases-section h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.025em;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.use-case-card {
    background: hsl(var(--muted) / 0.3);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.use-case-card:hover {
    background: hsl(var(--muted) / 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px hsl(var(--foreground) / 0.1);
}

.use-case-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
}

.use-case-card p {
    color: hsl(var(--muted-foreground));
    line-height: 1.5;
    font-size: 0.9rem;
}

/* More Tools Section */
.more-tools-section {
    padding: var(--spacing-2xl) 1rem;
    background: hsl(var(--muted) / 0.3);
}

.more-tools-section h2 {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: hsl(var(--foreground));
    font-size: var(--font-size-3xl);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    max-width: 800px;
    margin: 0 auto;
}

.tool-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    display: block;
}

.tool-card h3 {
    margin-bottom: var(--spacing-sm);
    color: hsl(var(--foreground));
}

.tool-card h3 a {
    text-decoration: none;
    color: inherit;
}

.tool-card p {
    margin-bottom: var(--spacing-lg);
    color: hsl(var(--muted-foreground));
    line-height: 1.5;
}

/* FAQ Section - specific overrides only */
.faq-section {
    padding: 3rem 1rem;
}

.faq-section h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.025em;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    margin-bottom: 1rem;
    background: hsl(var(--card));
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    box-shadow: 0 2px 4px hsl(var(--foreground) / 0.1);
}

.faq-question {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: hsl(var(--foreground));
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.faq-question:hover {
    background: hsl(var(--accent));
}

.faq-question[aria-expanded="true"] {
    background: hsl(var(--accent));
}

.faq-icon {
    font-size: 1.25rem;
    font-weight: 300;
    transition: transform 0.2s ease;
    color: hsl(var(--primary));
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: hsl(var(--muted) / 0.3);
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 1.25rem 1.5rem;
}

.faq-answer p {
    color: hsl(var(--muted-foreground));
    line-height: 1.6;
    margin: 0;
}


/* Modern Footer */
footer {
    background: hsl(var(--card) / 0.95);
    color: hsl(var(--muted-foreground));
    padding: var(--spacing-2xl) 0 var(--spacing-lg) 0;
    margin-top: var(--spacing-3xl);
    border-top: 1px solid hsl(var(--border));
    backdrop-filter: blur(12px);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-main h3 {
    color: hsl(var(--foreground));
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
}

.footer-main p {
    line-height: 1.6;
}

.footer-links h4,
.footer-legal h4 {
    color: hsl(var(--foreground));
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-base);
    font-weight: 600;
}

.footer-links ul,
.footer-legal ul {
    list-style: none;
    padding: 0;
}

.footer-links li,
.footer-legal li {
    margin-bottom: var(--spacing-xs);
}

footer a {
    color: hsl(var(--primary));
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

footer a:hover {
    color: hsl(var(--primary) / 0.8);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid hsl(var(--border) / 0.5);
    font-size: var(--font-size-sm);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
}

/* Mobile First Responsive Design */

/* Base styles are mobile-first (320px+) */
.main-section h1 {
    font-size: 1.75rem;
}

.main-interactive-element {
    width: 200px;
    height: 200px;
}

.coin {
    width: 200px;
    height: 200px;
}

.coin-face {
    font-size: 1rem;
    border-width: 4px;
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
}

.nav-container {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.nav-right {
    flex-direction: row;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.nav-menu {
    flex-direction: row;
    text-align: center;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.main-section {
    margin: 1rem auto;
    padding: 2rem 1rem;
}


/* Small phones (375px+) */
@media (min-width: 375px) {
    .main-interactive-element {
        width: 220px;
        height: 220px;
    }
    
    .coin {
        width: 220px;
        height: 220px;
    }
    
    .coin-face {
        font-size: 1.1rem;
        border-width: 5px;
    }
    
    .main-section h1 {
        font-size: 2rem;
    }
}

/* Large phones (480px+) */
@media (min-width: 480px) {
    .nav-container {
        flex-direction: row;
        padding: 1rem 20px;
        gap: 1rem;
    }
    
    .nav-right {
        flex-direction: row;
        gap: 1rem;
        justify-content: flex-end;
    }
    
    .nav-menu {
        flex-direction: row;
        text-align: left;
        gap: 0.5rem;
        flex: none;
    }
    
    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .coin-flipper-section,
    .features-section,
    .how-it-works-section,
    .use-cases-section {
        padding: 2.5rem 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .use-cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets (768px+) */
@media (min-width: 768px) {
    .main-interactive-element {
        width: 260px;
        height: 260px;
    }
    
    .coin {
        width: 260px;
        height: 260px;
    }
    
    .coin-face {
        font-size: 1.3rem;
        border-width: 6px;
    }
    
    .main-section h1 {
        font-size: 2.25rem;
    }
    
    .btn-large {
        padding: 1rem 2.5rem;
        font-size: 1.125rem;
    }
    
    .stats {
        grid-template-columns: repeat(3, 1fr);
        max-width: 500px;
        padding: 1.5rem;
    }
    
    .main-section {
        padding: 3rem 2rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .use-cases-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .main-interactive-element {
        width: 280px;
        height: 280px;
    }
    
    .coin {
        width: 280px;
        height: 280px;
    }
    
    .coin-face {
        font-size: 1.5rem;
        border-width: 6px;
    }
    
    .main-section h1 {
        font-size: 2.5rem;
    }
    
    .main-section {
        margin: 2rem auto;
    }
}

/* Large desktop (1280px+) */
@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }
    
    .coin-flipper-section,
    .info-section {
        padding: 3.5rem 2.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .coin {
        transition: none;
    }
    
    .result-animation {
        animation: none;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
button:focus,
.nav-link:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .coin-flipper-section,
    .info-section {
        background: white;
        border: 2px solid #333;
    }
    
}