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

:root {
    --primary-color: #1a73e8;
    --primary-dark: #1557b0;
    --secondary-color: #34a853;
    --accent-color: #ea4335;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --border-color: #dadce0;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

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

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 2px solid var(--border-color);
}

.category-btn {
    padding: 1rem 1.75rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
    font-family: inherit;
    white-space: nowrap;
}

.category-btn:hover {
    color: var(--primary-color);
    background: var(--bg-hover);
}

.category-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Calculator Grid */
.calculator-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.calculator-grid.active {
    display: grid;
}

.calculator-card {
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-family: inherit;
}

.calculator-card:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.calculator-card:active {
    transform: translateY(0);
}

/* Converter Sections */
.converter-section {
    display: none;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
}

.converter-section.active {
    display: block;
}

.converter-description {
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.converter-description p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.converter-description strong {
    color: var(--text-primary);
}

.converter-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
}

.converter-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    min-width: 280px;
}

.converter-input {
    padding: 1rem;
    font-size: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
    font-weight: 500;
}

.converter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.converter-input:read-only {
    background: var(--bg-secondary);
    cursor: not-allowed;
}

.converter-select {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
}

.converter-select:hover {
    border-color: var(--primary-color);
}

.converter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.converter-arrow {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 300;
    flex-shrink: 0;
}

/* BMI Calculator */
.bmi-calculator {
    max-width: 600px;
    margin: 0 auto;
}

.bmi-inputs {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.bmi-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bmi-input-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.bmi-input-with-unit {
    display: flex;
    gap: 0.75rem;
}

.bmi-input {
    flex: 1;
    padding: 1rem;
    font-size: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
    font-weight: 500;
}

.bmi-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.bmi-unit-select {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 100px;
}

.bmi-unit-select:hover {
    border-color: var(--primary-color);
}

.bmi-unit-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.bmi-result {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.bmi-value {
    margin-bottom: 1rem;
}

.bmi-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 0.5rem;
}

.bmi-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

.bmi-category {
    font-size: 1.5rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    display: inline-block;
}

.bmi-underweight {
    background: rgba(66, 133, 244, 0.1);
    color: #4285f4;
}

.bmi-normal {
    background: rgba(52, 168, 83, 0.1);
    color: var(--secondary-color);
}

.bmi-overweight {
    background: rgba(251, 188, 4, 0.1);
    color: #fbbc04;
}

.bmi-obese {
    background: rgba(234, 67, 53, 0.1);
    color: var(--accent-color);
}

/* Health Calculators (Body Fat, Ideal Weight, BMR, TDEE) */
.health-calculator {
    max-width: 600px;
    margin: 0 auto;
}

.health-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.health-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.health-input-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.health-input-with-unit {
    display: flex;
    gap: 0.75rem;
}

.health-input {
    flex: 1;
    padding: 1rem;
    font-size: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
    font-weight: 500;
}

.health-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.health-select {
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
}

.health-select:hover {
    border-color: var(--primary-color);
}

.health-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.health-unit-select {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 100px;
}

.health-unit-select:hover {
    border-color: var(--primary-color);
}

.health-unit-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.health-result {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.health-value {
    margin-bottom: 0;
}

.health-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 0.5rem;
}

.health-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

.health-unit {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 0.25rem;
}

.health-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.health-separator {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.health-disclaimer {
    margin-top: 2rem;
    padding: 1.25rem;
    background: rgba(251, 188, 4, 0.1);
    border: 1px solid rgba(251, 188, 4, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.health-disclaimer p {
    margin: 0;
    color: var(--text-primary);
}

.health-disclaimer strong {
    color: var(--text-primary);
}

/* Info Section */
.info-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    line-height: 1.8;
}

.info-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-section h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.info-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.info-section li {
    margin-bottom: 0.5rem;
}

.info-section strong {
    color: var(--text-primary);
}

.license-text {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.license-text h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-family: inherit;
    font-size: 1.1rem;
}

.license-text p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.license-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Ad Containers */
.ad-container {
    width: 100%;
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.ad-wrapper {
    min-height: 100px;
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-secondary);
    border-radius: 8px;
}

.ad-top {
    margin-top: 0;
}

.ad-inline {
    margin: 3rem 0;
}

.ad-bottom {
    margin-bottom: 0;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

footer p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-other-tools {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.footer-other-tools p {
    margin-bottom: 0.5rem;
}

.footer-other-tools strong {
    color: var(--text-primary);
}

/* Percentage Calculator Styles */
.percentage-calculator {
    margin-top: 2rem;
}

.percentage-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.percentage-tab-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.percentage-tab-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.percentage-tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.percentage-calc {
    display: none;
}

.percentage-calc.active {
    display: block;
}

.percentage-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.percentage-input-group label {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

.percentage-input {
    flex: 1;
    min-width: 150px;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.percentage-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.percentage-calc-btn {
    padding: 0.875rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-bottom: 1.5rem;
}

.percentage-calc-btn:hover {
    background: var(--primary-dark);
}

.percentage-result {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.percentage-result-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Date Calculator Styles */
.date-calculator {
    margin-top: 2rem;
}

.date-inputs {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.date-input-group {
    flex: 1;
    min-width: 200px;
}

.date-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.date-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.date-calc-btn {
    padding: 0.875rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-bottom: 2rem;
}

.date-calc-btn:hover {
    background: var(--primary-dark);
}

.date-result {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.date-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.date-result-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.date-result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.approximation-note {
    font-size: 0.7rem;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-secondary);
    opacity: 0.8;
}

.date-disclaimer {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Discount Calculator Styles */
.discount-calculator {
    margin-top: 2rem;
}

.discount-inputs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.discount-input-group {
    flex: 1;
    min-width: 200px;
}

.discount-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.discount-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.discount-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.discount-preset-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.discount-preset-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.discount-preset-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.discount-calc-btn {
    padding: 0.875rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-bottom: 2rem;
}

.discount-calc-btn:hover {
    background: var(--primary-dark);
}

.discount-result {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.discount-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.discount-result-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.discount-result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discount-result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.tip-calculator {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.bill-mode-toggle {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.bill-mode-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bill-mode-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.currency-hint {
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
}

.bill-mode-panel {
    display: none;
}

.bill-mode-panel.active {
    display: block;
}

.bill-controls {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.bill-field {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bill-field label,
.bill-field-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.bill-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.bill-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.rounding-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rounding-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
}

.rounding-option input {
    margin: 0;
}

.currency-symbol-inline {
    font-weight: 600;
    color: var(--text-secondary);
}

.currency-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0 0.75rem;
    background: white;
    min-height: 48px;
}

.currency-input .currency-symbol {
    font-weight: 600;
    color: var(--text-secondary);
}

.currency-input input {
    border: none;
    flex: 1;
    padding: 0.75rem 0;
    font-size: 1rem;
    background: transparent;
}

.currency-input input:focus {
    outline: none;
}

.friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.friends-header h3 {
    margin-bottom: 0.25rem;
}

.friends-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bill-action-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bill-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.bill-action-btn.primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.bill-action-btn.primary:hover {
    background: var(--primary-dark);
}

.bill-action-btn.ghost {
    background: transparent;
}

.friends-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.friend-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.friend-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.text-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.text-btn:hover {
    text-decoration: underline;
}

.friend-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.friend-item-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.bill-result {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.bill-summary p {
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.bill-result-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.bill-result-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-secondary);
}

.bill-result-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.bill-result-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.bill-result-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.bill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* Bill Scanning Styles */
.bill-scan-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.bill-scan-controls .bill-field {
    margin: 0;
}

.bill-scan-panel {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.bill-scan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.bill-scan-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.bill-scan-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.bill-scan-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.bill-scan-item:hover {
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.05);
    transform: translateY(-2px);
}

.bill-scan-item.assigned {
    opacity: 0.5;
    background: rgba(52, 168, 83, 0.1);
    border-color: var(--secondary-color);
}

.bill-scan-item-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.bill-scan-item-price-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bill-scan-item-price {
    font-weight: 600;
    color: var(--primary-color);
}

.bill-scan-edit-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.bill-scan-edit-btn:hover {
    opacity: 1;
}

.bill-scan-price-input {
    padding: 0.25rem 0.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

.bill-scan-price-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.bill-scan-save-btn,
.bill-scan-cancel-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.bill-scan-save-btn:hover {
    background: var(--primary-dark);
}

.bill-scan-cancel-btn {
    background: var(--text-secondary);
}

.bill-scan-cancel-btn:hover {
    background: var(--accent-color);
}

.bill-scan-hint {
    padding: 0.75rem;
    background: rgba(26, 115, 232, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.bill-scan-hint p {
    margin: 0;
}

.bill-scan-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.friend-card.drag-over {
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.05);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Bill Assignment Modal */
.bill-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.bill-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.bill-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
}

.bill-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.bill-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.bill-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.bill-modal-close:hover {
    color: var(--text-primary);
}

.bill-modal-body {
    padding: 1.5rem;
}

.bill-assign-item-info {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.bill-assign-item-info p {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.bill-assign-item-info strong {
    color: var(--text-secondary);
}

.bill-assign-prompt {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.bill-assign-friends-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bill-assign-friend-option {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bill-assign-friend-option:hover {
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bill-assign-friend-option:active {
    transform: translateY(0);
}

.bill-assign-friend-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.bill-assign-friend-arrow {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.discount-final {
    color: #28a745;
}

.discount-savings {
    color: #dc3545;
}

/* Roman Numeral Converter Styles */
.roman-calculator {
    margin-top: 2rem;
}

.roman-inputs {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.roman-input-group {
    flex: 1;
    min-width: 200px;
}

.roman-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.roman-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-transform: uppercase;
}

.roman-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.roman-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    user-select: none;
}

.roman-examples {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.roman-examples p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Number Base Converter Styles */
.numberbase-calculator {
    margin-top: 2rem;
}

.numberbase-inputs {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.numberbase-input-group {
    flex: 1;
    min-width: 250px;
}

.numberbase-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.numberbase-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    margin-bottom: 0.75rem;
}

.numberbase-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.numberbase-select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

.numberbase-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.numberbase-error {
    padding: 1rem;
    background: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
    border-radius: 4px;
    color: #dc3545;
    font-weight: 500;
}

.date-result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .category-tabs {
        flex-direction: row;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-btn {
        flex-shrink: 0;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .calculator-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .calculator-card {
        padding: 1.25rem;
        font-size: 1rem;
    }
    
    .converter-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .bmi-input-with-unit {
        flex-direction: column;
    }
    
    .bmi-unit-select {
        width: 100%;
    }
    
    .bmi-number {
        font-size: 2.5rem;
    }
    
    .bmi-category {
        font-size: 1.25rem;
    }
    
    .health-input-with-unit {
        flex-direction: column;
    }
    
    .health-unit-select {
        width: 100%;
    }
    
    .health-number {
        font-size: 2rem;
    }
    
    .health-range {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .health-separator {
        display: none;
    }
    
    .converter-arrow {
        transform: rotate(90deg);
        font-size: 2rem;
    }
    
    .converter-input-group {
        min-width: 100%;
    }
    
    .converter-section {
        padding: 2rem 1.5rem;
    }
    
    .converter-description {
        padding: 0.875rem 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .converter-description p {
        font-size: 0.9rem;
    }
    
    .info-section {
        padding: 1.5rem;
    }
    
    .info-section h2 {
        font-size: 1.75rem;
    }
    
    .info-section h3 {
        font-size: 1.25rem;
    }
    
    main {
        padding: 2rem 0;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }
    
    .converter-section {
        padding: 1.5rem 1rem;
    }
    
    .converter-input {
        font-size: 1.1rem;
    }

    .percentage-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .percentage-input {
        min-width: 100%;
    }

    .date-inputs {
        flex-direction: column;
    }

    .date-result-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .date-result-value {
        font-size: 1.5rem;
    }

    .discount-inputs {
        flex-direction: column;
    }

    .discount-result-grid {
        grid-template-columns: 1fr;
    }

    .discount-result-value {
        font-size: 1.5rem;
    }

    .roman-inputs,
    .numberbase-inputs {
        flex-direction: column;
    }

    .roman-arrow {
        align-self: center;
        transform: rotate(90deg);
    }
}

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

/* Focus Styles for Accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Copy URL Button */
.copy-url-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    margin: 1rem 0;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.copy-url-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.copy-url-btn:active {
    transform: translateY(0);
}

.copy-icon {
    font-size: 1.1rem;
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    max-width: 300px;
}

.copy-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.copy-notification.success {
    border-color: var(--secondary-color);
    background: #e8f5e9;
    color: #1b5e20;
}

.copy-notification.error {
    border-color: var(--accent-color);
    background: #ffebee;
    color: #b71c1c;
}

@media (max-width: 768px) {
    .copy-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

