/* ========================================
   Tip Calculator - Styles
   Matching splitcostonline.com design
   ======================================== */

/* CSS Variables */
:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;

    /* Status Colors */
    --success: #10b981;
    --success-hover: #059669;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;

    /* Grayscale */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

/* Language Navigation */
.language-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
}

.lang-link {
    color: var(--white);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    opacity: 0.8;
}

.lang-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.lang-link.active {
    background: var(--white);
    color: var(--primary);
    opacity: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 400px;
    margin: 0 auto;
}

/* Calculator Card */
.calculator-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 1.5rem;
    width: 100%;
    animation: cardIn 0.3s ease-out;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Calculator Form */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Input Groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.input-group label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--gray-800);
    transition: var(--transition);
    background: var(--white);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-wrapper input:hover:not(:focus) {
    border-color: var(--gray-300);
}

/* Currency Input */
.currency-input .currency-symbol {
    position: absolute;
    left: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    pointer-events: none;
}

.currency-input input {
    padding-left: 1.75rem;
}

/* Percentage Input */
.percentage-input .percentage-symbol {
    position: absolute;
    right: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    pointer-events: none;
}

.percentage-input input {
    padding-right: 2rem;
}

/* Input Help Text */
.input-help {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* Button Group */
.button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

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

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

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-danger {
    background: var(--danger);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-icon {
    flex-shrink: 0;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

/* Results Section */
.results-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--gray-100);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section.hidden {
    display: none;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
    text-align: center;
}

.results-grid {
    display: grid;
    gap: 0.75rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
}

.result-item.highlight {
    background: var(--success-light);
    border-color: var(--success);
}

.result-label {
    font-weight: 500;
    color: var(--gray-600);
}

.result-item.highlight .result-label {
    color: var(--success-hover);
}

.result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.result-item.highlight .result-value {
    color: var(--success-hover);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem 1rem;
    color: var(--white);
}

.footer-text {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.375rem;
}

.footer-privacy {
    font-size: 0.8125rem;
    opacity: 0.75;
    margin-bottom: 0.75rem;
}

.footer-link a {
    color: var(--white);
    text-decoration: underline;
    font-size: 0.875rem;
    opacity: 0.9;
    transition: var(--transition);
}

.footer-link a:hover {
    opacity: 1;
}

/* Responsive Design */

/* Mobile - Small screens */
@media (max-width: 480px) {
    .app-container {
        padding: 0.75rem;
    }

    .language-nav {
        gap: 0.375rem;
        padding: 0.5rem;
    }

    .lang-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.8125rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.875rem;
    }

    .calculator-card {
        padding: 1.25rem;
    }

    .calculator-form {
        gap: 1rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        padding: 0.75rem 1rem;
    }

    .result-value {
        font-size: 1.125rem;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    .main-content {
        max-width: 560px;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .app-container {
        padding: 1.5rem;
    }

    .calculator-card {
        padding: 2rem;
    }

    .header h1 {
        font-size: 2.25rem;
    }

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

/* Large Desktop */
@media (min-width: 1024px) {
    .main-content {
        max-width: 680px;
    }
}

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

    html {
        scroll-behavior: auto;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .language-nav,
    .button-group,
    .footer {
        display: none;
    }

    .calculator-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}

/* Focus Styles for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Hide elements visually but keep for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
