/* ===============================================
   TIP CALCULATOR - USING MODERNTOOLS UNIFIED THEME
   =============================================== */

/* Use modern tools color scheme */
:root {
    --primary-color: #3B82F6;
    --secondary-color: #10B981;
    --accent-color: #8B5CF6;
    --text-color: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-base: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;    
    --radius-2xl: 1.5rem;
    
    /* Gray color scale for consistency */
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    
    /* Additional colors for tip calculator functionality */
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --info-color: #3B82F6;
    
    /* Tip calculator specific colors */
    --tip-green: #10B981;
    --tip-blue: #3B82F6;
    --tip-purple: #8B5CF6;
    --tip-orange: #F59E0B;
}

/* Dark theme using exact same colors as percentage calculator */
[data-theme="dark"] {
    --text-color: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    
    /* Gray color scale for dark theme */
    --gray-100: #374151;
    --gray-200: #4B5563;
    --gray-300: #6B7280;
    --gray-400: #9CA3AF;
}

/* Theme-aware background support for the entire calculator */
body {
    background: var(--bg-primary);
}

/* Dark theme override for body */
[data-theme="dark"] body {
    background: var(--bg-primary);
}

/* Main Layout */
.main-content {
    min-height: 100vh;
}

/* ===============================================
   HERO SECTION STYLES
   =============================================== */

.tool-hero {
    margin-top: 0;
    padding: 120px 0 80px;
    position: relative;
    z-index: 2;
    background:  linear-gradient(135deg, var(--bg-primary) 0%, rgba(59, 130, 246, 0.1) 30%, rgba(16, 185, 129, 0.1) 70%, var(--bg-primary) 100%);
    overflow: hidden;
}

.tool-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.tool-hero .container {
    position: relative;
    z-index: 3;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.hero-icon i {
    font-size: 3rem;
    color: white;
}

.tool-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.tool-hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

/* ===============================================
   CALCULATOR MAIN SECTION
   =============================================== */

.calculator-main {
    padding: 60px 0 120px;
    background: var(--bg-primary);
}

.calculator-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

/* ===============================================
   MODE TOGGLE STYLES
   =============================================== */

.calculator-mode-toggle {
    text-align: center;
    margin-bottom: 2rem;
}

.toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.toggle-label.active {
    color: var(--primary-color);
}

.mode-toggle {
    width: 48px;
    height: 24px;
    background: var(--gray-300);
    border: none;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mode-toggle.active {
    background: var(--primary-color);
}

.toggle-slider {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.mode-toggle.active .toggle-slider {
    transform: translateX(24px);
}

/* ===============================================
   CALCULATOR TABS
   =============================================== */

.calculator-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.tab-button {
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.tab-button:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.tab-button.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* ===============================================
   CALCULATOR CARD
   =============================================== */

.calculator-card {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* ===============================================
   DISPLAY AREA
   =============================================== */

.calculator-display {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.display-result {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.result-unit {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.display-formula {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===============================================
   INPUT SECTIONS
   =============================================== */

.input-section {
    display: none;
}

.input-section.active {
    display: block;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-color);
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===============================================
   CURRENCY INPUT
   =============================================== */

.bill-input-group {
    margin-bottom: 2rem;
}

.bill-input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.bill-input-group label i {
    color: var(--primary-color);
    font-size: 1.125rem;
}

.currency-input {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    z-index: 2;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    pointer-events: none;
}

.currency-input input {
    padding-left: 2.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    height: 60px;
    background: var(--bg-secondary);
}

/* ===============================================
   ENHANCED BILL AMOUNT VISUALS
   =============================================== */

.currency-input.enhanced {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    overflow: hidden;
}

.currency-input.enhanced:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.currency-input.enhanced .currency-symbol {
    position: static;
    background: var(--bg-secondary);
    padding: 0 1rem;
    height: 60px;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border-color);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 60px;
    justify-content: center;
}

.currency-input.enhanced input {
    flex: 1;
    border: none;
    padding: 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    height: 60px;
    background: transparent;
    color: var(--text-color);
    margin: 0;
}

.currency-input.enhanced input:focus {
    outline: none;
    box-shadow: none;
}

.currency-input.enhanced .input-icon {
    padding: 0 1rem;
    border-left: 1px solid var(--border-color);
    background: var(--bg-secondary);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.currency-input.enhanced .input-icon i {
    color: var(--text-tertiary);
    font-size: 1.125rem;
    transition: color 0.2s ease;
}

.currency-input.enhanced:focus-within .input-icon i {
    color: var(--primary-color);
}

.bill-amount-helper {
    margin-top: 0.5rem;
    text-align: center;
}

.helper-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Animation for enhanced inputs */
.currency-input.enhanced {
    transform: scale(1);
    transition: all 0.2s ease;
}

.currency-input.enhanced:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.currency-input.enhanced:focus-within {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--shadow-md);
}

/* Dark theme adjustments for enhanced inputs */
[data-theme="dark"] .currency-input.enhanced .currency-symbol,
[data-theme="dark"] .currency-input.enhanced .input-icon {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* ===============================================
   TIP PRESETS
   =============================================== */

.tip-presets {
    margin-bottom: 2rem;
}

.preset-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.preset-btn {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
}

.preset-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.preset-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

/* ===============================================
   SERVICE QUALITY BUTTONS
   =============================================== */

.service-quality {
    margin-bottom: 2rem;
}

.service-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.quality-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.quality-btn {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-height: 80px;
}

.quality-btn i {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.quality-btn span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.quality-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.quality-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.quality-btn.active i,
.quality-btn.active span {
    color: white;
}

/* ===============================================
   ROUNDING OPTIONS
   =============================================== */

.rounding-options {
    margin-bottom: 2rem;
}

.rounding-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.rounding-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.round-btn {
    padding: 0.875rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.round-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.round-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

/* ===============================================
   PEOPLE INPUT
   =============================================== */

.people-input {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.people-btn {
    width: 48px;
    height: 56px;
    background: var(--bg-secondary);
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.people-btn:hover {
    background: var(--primary-color);
    color: white;
}

.people-input input {
    flex: 1;
    border: none;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    height: 56px;
    box-shadow: none;
    background: var(--bg-secondary);
}

/* ===============================================
   CUSTOM SPLIT
   =============================================== */

.custom-split-container {
    margin-bottom: 2rem;
}

.custom-split-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.custom-split-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.custom-split-item label {
    min-width: 80px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.custom-split-item .currency-input {
    flex: 1;
}

.add-person-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.add-person-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===============================================
   TIP CALCULATION METHOD
   =============================================== */

.tip-calculation-method {
    margin-bottom: 2rem;
}

.method-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.method-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.method-btn {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.method-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.method-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

/* ===============================================
   CALCULATOR ACTIONS
   =============================================== */

.calculator-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.calculate-btn,
.clear-btn {
    flex: 1;
    padding: 1.25rem;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.calculate-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.clear-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.clear-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
    border-color: var(--text-tertiary);
    transform: translateY(-1px);
}

.calculate-btn:active,
.clear-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .calculator-actions {
        flex-direction: column;
    }
    
    .calculate-btn,
    .clear-btn {
        width: 100%;
    }
}

/* ===============================================
   RESULTS PANEL
   =============================================== */

.results-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.results-panel.active {
    right: 0;
    overflow: hidden;
}

.results-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: between;
    background: var(--bg-secondary);
}

.results-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
}

.results-close {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-base);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.results-close:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.results-content {
    padding: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.total {
    background: var(--bg-secondary);
    margin: 1rem -1.5rem;
    padding: 1.5rem;
    border-bottom: none;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.result-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.result-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.result-item.total .result-value {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.custom-split-results {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.custom-split-results .result-item {
    padding: 0.75rem 0;
}

.results-actions {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    flex: 1;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* ===============================================
   REMOVE PERSON BUTTON
   =============================================== */

.remove-person-btn {
    width: 32px;
    height: 32px;
    background: var(--danger-color);
    border: none;
    border-radius: var(--radius-base);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.remove-person-btn:hover {
    background: #DC2626;
    transform: scale(1.05);
}

.remove-person-btn i {
    font-size: 0.75rem;
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 768px) {
    .tool-hero {
        padding: 100px 0 60px;
    }
    
    .tool-hero h1 {
        font-size: 2.5rem;
    }
    
    .tool-hero p {
        font-size: 1.125rem;
    }
    
    .hero-icon {
        width: 100px;
        height: 100px;
    }
    
    .hero-icon i {
        font-size: 2.5rem;
    }
    
    .calculator-main {
        padding: 40px 0 80px;
    }
    
    .calculator-card {
        padding: 1.5rem;
    }
    
    .calculator-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .preset-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .quality-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .results-panel {
        width: 100%;
        right: -100%;
    }
    
    .display-result .result-value {
        font-size: 2.5rem;
    }
    
    .currency-input input {
        font-size: 1.125rem;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .tool-hero h1 {
        font-size: 2rem;
    }
    
    .calculator-card {
        padding: 1rem;
    }
    
    .calculator-tabs {
        grid-template-columns: 1fr;
    }
    
    .preset-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quality-buttons {
        grid-template-columns: 1fr;
    }
    
    .rounding-buttons {
        grid-template-columns: 1fr;
    }
    
    .method-buttons {
        grid-template-columns: 1fr;
    }
    
    .display-result .result-value {
        font-size: 2rem;
    }
    
    .custom-split-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .custom-split-item label {
        min-width: auto;
    }
}

/* Additional responsive improvements */
@media (max-width: 640px) {
    .custom-split-item {
        padding: 1rem;
        background: var(--bg-secondary);
        border-radius: var(--radius-lg);
        margin-bottom: 1rem;
    }
    
    .custom-split-item label {
        font-weight: 600;
        color: var(--text-color);
        margin-bottom: 0.5rem;
    }
}

/* ===============================================
   ANIMATIONS
   =============================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===============================================
   ADVANCED MODE STYLES
   =============================================== */

.advanced-options {
    display: none;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.advanced-options.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.advanced-options h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* ===============================================
   ACCESSIBILITY IMPROVEMENTS
   =============================================== */

.calculate-btn:focus,
.clear-btn:focus,
.preset-btn:focus,
.quality-btn:focus,
.round-btn:focus,
.method-btn:focus,
.tab-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===============================================
   PRINT STYLES
   =============================================== */

@media print {
    .navbar,
    .footer,
    .tool-hero,    .calculator-tabs,
    .calculate-btn,
    .clear-btn,
    .results-actions {
        display: none;
    }
    
    .calculator-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .results-panel {
        position: static;
        width: 100%;
        box-shadow: none;
        border: 1px solid #000;
    }
}
