/* InoBill - Modern Clean Design */

/* CSS Variables */
:root {
    /* Primary Colors */
    --primary-50: #f0f4ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;
    
    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Status Colors */
    --success-50: #ecfdf5;
    --success-500: #10b981;
    --success-600: #059669;
    --error-50: #fef2f2;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --warning-50: #fffbeb;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    /* Text Colors - Improved contrast ratios */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #475569;
    --text-muted: #64748b;
    
    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    
    /* Shadow Colors */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-tertiary: #cbd5e1;
    --text-muted: #a0aec0;
    --border-light: #334155;
    --border-medium: #475569;
    --border-dark: #64748b;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary) !important;
    line-height: 1.6;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 400;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1200px;
    margin: var(--space-8) auto;
    min-height: calc(100vh - var(--space-16));
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    color: white;
    padding: var(--space-8) var(--space-6);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.logo {
    width: 100px;
    height: 100px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

.title-section h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.title-section p {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 400;
    margin-bottom: var(--space-2);
}

.header-features {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.feature-tag {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: var(--space-1) var(--space-2);
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.btn-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Content */
.content {
    padding: var(--space-8) var(--space-6);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.quick-action-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-action-btn:hover::before {
    opacity: 0.1;
}

.quick-action-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-300);
}

.action-icon {
    font-size: 2rem;
    margin-bottom: var(--space-3);
    display: block;
    position: relative;
    z-index: 1;
}

.action-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
    align-items: start;
}

/* Cards */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    align-self: start;
    height: fit-content;
}

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

.card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    padding: var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2,
.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-add {
    width: 32px;
    height: 32px;
    background: var(--primary-500);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-add:hover {
    background: var(--primary-600);
    transform: scale(1.1);
}

.btn-calculate {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none;
    border-radius: var(--radius-lg);
    color: white !important;
    cursor: pointer;
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    justify-content: center;
}

.btn-calculate:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-calculate:active {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
    color: white !important;
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.btn-calculate .btn-icon {
    font-size: 1.25rem;
    color: white !important;
}

.btn-calculate .btn-text {
    font-weight: 700;
    color: white !important;
}

.btn-calculate:hover .btn-icon,
.btn-calculate:hover .btn-text {
    color: white !important;
}

.card-content {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6) var(--space-6);
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    display: flex;
    justify-content: center;
}

/* List Container */
.list-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--text-tertiary);
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-4);
    display: block;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.875rem;
    font-weight: 500;
}

/* List Items */
.participant-item,
.menu-item,
.additional-cost-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.participant-item::before,
.menu-item::before,
.additional-cost-item::before,
.discount-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.discount-item::before {
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
}

.participant-item:hover::before,
.menu-item:hover::before,
.additional-cost-item:hover::before,
.discount-item:hover::before {
    transform: scaleY(1);
}

.participant-item:hover,
.menu-item:hover,
.additional-cost-item:hover,
.discount-item:hover {
    padding-left: 16px;
    background: var(--bg-tertiary);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.participant-item span,
.menu-item .name,
.additional-cost-item .name,
.discount-item .name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.menu-item .price,
.additional-cost-item .amount,
.discount-item .amount {
    font-weight: 600;
    color: var(--primary-600);
    font-family: 'JetBrains Mono', monospace;
    background: var(--primary-50);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-right: var(--space-3);
}

.discount-item .amount {
    color: var(--success-600);
    background: var(--success-50);
}

[data-theme="dark"] .menu-item .price,
[data-theme="dark"] .additional-cost-item .amount {
    background: var(--primary-900);
    color: var(--primary-300);
}

[data-theme="dark"] .discount-item .amount {
    background: var(--success-900);
    color: var(--success-300);
}

.remove-btn {
    background: var(--error-500);
    color: white;
    border: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.remove-btn:hover {
    background: var(--error-600);
    opacity: 1;
    transform: scale(1.05);
}

/* Orders Grid */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}

.participant-orders {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.participant-orders h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-light);
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.order-item {
    display: block;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.order-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-300);
}

.order-item.selected {
    background: var(--primary-50);
    border-color: var(--primary-500);
}

.order-checkbox {
    float: left;
    margin-right: 12px;
    margin-top: 2px;
}

.order-checkbox input[type="checkbox"] {
    accent-color: var(--primary-500);
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.order-details {
    overflow: hidden;
    margin-bottom: 8px;
}

.order-details .name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.order-details .price {
    font-weight: 600;
    color: var(--primary-600);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    float: right;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    float: right;
    clear: both;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
    line-height: 1;
    user-select: none;
}

.qty-btn:hover {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
    transform: translateY(-1px);
}

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

.qty-input {
    width: 50px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1;
    box-sizing: border-box;
}

.qty-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Responsive adjustments for order items */
@media (max-width: 768px) {
    .order-item {
        padding: 10px 12px;
    }
    
    .order-checkbox input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    
    .order-details .name {
        font-size: 0.9rem;
    }
    
    .order-details .price {
        font-size: 0.8rem;
    }
    
    .qty-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .qty-input {
        width: 45px;
        height: 28px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .order-item {
        padding: 12px;
    }
    
    .order-checkbox {
        float: none;
        margin-bottom: 8px;
    }
    
    .order-details {
        margin-bottom: 12px;
    }
    
    .order-details .name {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    
    .order-details .price {
        float: none;
        display: block;
        font-size: 0.85rem;
    }
    
    .quantity-controls {
        float: none;
        justify-content: center;
        margin-top: 8px;
    }
}

/* Results Section */
.results-section {
    margin-top: var(--space-8);
}

.results-section * {
    color: inherit !important;
}

.results-section .participant-name {
    color: var(--text-primary) !important;
    font-weight: 600;
}

.results-section .participant-amount {
    color: var(--primary-600) !important;
    font-weight: 700;
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.results-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
}

.results-summary h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.results-summary p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.participant-result {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
    color: var(--text-primary) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.participant-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
}

.participant-info {
    flex: 1;
}

.participant-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary) !important;
    margin-bottom: var(--space-2);
}

.participant-items {
    font-size: 0.875rem;
    color: var(--text-secondary) !important;
    line-height: 1.4;
}

.participant-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-600) !important;
    background: var(--primary-50);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    text-align: center;
    min-width: 120px;
}

[data-theme="dark"] .participant-amount {
    background: var(--primary-900);
    color: var(--primary-300) !important;
}

/* Dark theme fixes for inline styles in calculation breakdown */
[data-theme="dark"] div[style*="background: rgba(255, 255, 255, 0.8)"] {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] div[style*="color: #007bff"] {
    color: var(--primary-400) !important;
}

[data-theme="dark"] div[style*="color: #ff6b6b"] {
    color: var(--error-400) !important;
}

[data-theme="dark"] div[style*="color: #28a745"] {
    color: var(--success-400) !important;
}

[data-theme="dark"] div[style*="color: #666"] {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] div[style*="background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%)"] {
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] div[style*="background: rgba(40, 167, 69, 0.1)"] {
    background: rgba(16, 185, 129, 0.1) !important;
}

[data-theme="dark"] div[style*="border: 1px solid #dee2e6"] {
    border-color: var(--border-medium) !important;
}

[data-theme="dark"] div[style*="border-top: 1px solid #dee2e6"] {
    border-top-color: var(--border-medium) !important;
}

/* Override text colors in calculation sections */
[data-theme="dark"] .results-section div[style*="font-size: 0.9em"] span {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .results-section div[style*="font-size: 0.9em"] span[style*="font-weight: 600"] {
    color: var(--text-primary) !important;
}

/* Card Collapse Functionality */
.card-header {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.card-header:hover {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-collapse {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-collapse:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.collapse-icon {
    transition: transform 0.3s ease;
    font-size: 0.875rem;
}

/* Collapsed state */
.card.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.card.collapsed .card-header {
    border-radius: var(--radius-lg);
}

.card.collapsed .card-content {
    display: none !important;
}

.card.collapsed .card-footer {
    display: none !important;
}

.card.collapsed {
    height: auto !important;
    min-height: auto !important;
    align-self: start !important;
}

/* Dark theme for collapse */
[data-theme="dark"] .card-header:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .btn-collapse {
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-collapse:hover {
    background: var(--bg-primary);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.participant-result h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary) !important;
    margin-bottom: var(--space-2);
}

.result-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.amount-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.amount-breakdown span {
    font-size: 0.875rem;
    color: var(--text-secondary) !important;
}

.total-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-50) !important;
}

.total-summary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    text-align: center;
    margin-top: var(--space-4);
}

.total-summary h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
    color: var(--primary-50) !important;
}

.summary-breakdown {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    opacity: 0.9;
}

.result-actions {
    display: flex;
    gap: var(--space-3);
}

.action-buttons {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-action:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    padding: var(--space-4);
    overflow-y: auto; /* Allow modal container to scroll if needed */
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh; /* Use viewport height instead of calc */
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    margin: auto; /* Center the modal content */
    position: relative; /* Ensure proper positioning */
}

.modal.show .modal-content {
    transform: scale(1);
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.modal-header {
    padding: var(--space-6) var(--space-6) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-6);
    flex: 1;
    overflow-y: auto; /* Allow scrolling only within modal body if content overflows */
    max-height: calc(90vh - 120px); /* Reserve space for header and footer */
}

.modal-footer {
    padding: var(--space-4) var(--space-6) var(--space-6);
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    flex-shrink: 0;
}

/* Form Groups */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.form-group select {
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: var(--space-6);
    text-align: center;
    color: var(--text-secondary);
}

.footer-content p {
    margin-bottom: var(--space-2);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-500);
}

/* Floating Reset Button */
.floating-reset-btn {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    background: var(--error-500);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    font-size: 0.875rem;
}

.floating-reset-btn:hover {
    background: var(--error-600);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.floating-btn-icon {
    font-size: 1rem;
}

.floating-btn-text {
    font-size: 0.875rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 300px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid var(--success-500);
    background: var(--success-50);
}

.toast-error {
    border-left: 4px solid var(--error-500);
    background: var(--error-50);
}

.toast-warning {
    border-left: 4px solid var(--warning-500);
    background: var(--warning-50);
}

.toast-info {
    border-left: 4px solid var(--primary-500);
    background: var(--primary-50);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Dark theme toast adjustments */
[data-theme="dark"] .toast-success {
    background: rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .toast-error {
    background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .toast-warning {
    background: rgba(245, 158, 11, 0.1);
}

[data-theme="dark"] .toast-info {
    background: rgba(99, 102, 241, 0.1);
}

/* PWA Banners */
.pwa-install-banner,
.pwa-update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    color: white;
    padding: var(--space-4);
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pwa-install-banner.show,
.pwa-update-banner.show {
    transform: translateY(0);
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    max-width: 1200px;
    margin: 0 auto;
}

.pwa-banner-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
}

.pwa-banner-text h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.pwa-banner-text p {
    font-size: 0.875rem;
    opacity: 0.9;
}

.pwa-banner-actions {
    display: flex;
    gap: var(--space-3);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    background: var(--warning-500);
    color: white;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.offline-content {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: var(--space-4);
        border-radius: var(--radius-lg);
    }
    
    .header {
        padding: var(--space-6) var(--space-4);
    }
    
    .header-content {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
    
    .header-features {
        justify-content: center;
    }
    
    .feature-tag {
        font-size: 0.7rem;
        padding: var(--space-1);
    }

    .content {
        padding: var(--space-6) var(--space-4);
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    
    .modal {
        padding: var(--space-2);
    }
    
    .modal-content {
        max-height: calc(100vh - 1rem);
        width: 100%;
        max-width: none;
    }
    
    .modal-body {
        padding: var(--space-4);
    }
    
    .modal-footer {
        padding: var(--space-3) var(--space-4) var(--space-4);
    }
    
    .btn-calculate {
        min-width: 150px;
        padding: var(--space-3) var(--space-6);
        font-size: 0.875rem;
    }
    
    .participant-result {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .participant-amount {
        align-self: flex-end;
        min-width: 100px;
        font-size: 1.125rem;
        padding: var(--space-2) var(--space-3);
    }
    
    .dashboard {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .orders-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: var(--space-4);
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .floating-reset-btn {
        bottom: var(--space-4);
        right: var(--space-4);
    }
    
    .toast {
        right: var(--space-4);
        left: var(--space-4);
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .quick-action-btn {
        padding: var(--space-4);
    }
    
    .action-icon {
        font-size: 1.5rem;
    }
    
    .card-header {
        padding: var(--space-4);
    }
    
    .card-content {
        padding: var(--space-4);
    }
    
    .participant-item,
    .menu-item,
    .additional-cost-item {
        padding: var(--space-3);
    }
    
    .modal-content {
        width: 100%;
        margin: var(--space-2);
        border-radius: var(--radius-lg);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-4);
    }
    
    .floating-reset-btn {
        bottom: var(--space-2);
        right: var(--space-2);
        padding: var(--space-3);
    }
    
    .floating-btn-text {
        display: none;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-in {
    animation: slideIn 0.3s ease;
}

.slide-in-right {
    animation: slideInRight 0.3s ease;
}

.scale-in {
    animation: scaleIn 0.3s ease;
}

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.3s ease;
}

/* Override for calculate button to ensure proper styling */
.btn-calculate,
.btn-calculate * {
    transition: all 0.3s ease !important;
}

/* Force calculate button styling to override any global styles */
.btn-calculate {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
}

.btn-calculate:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    color: white !important;
}

.btn-calculate:active {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
    color: white !important;
}

.btn-calculate:focus {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
}

/* Hover effects */
.btn:hover,
.quick-action-btn:hover,
.card:hover,
.participant-item:hover,
.menu-item:hover,
.additional-cost-item:hover,
.order-item:hover {
    transform: translateY(-2px);
}

/* Exclude calculate button from global hover transform */
.btn-calculate:hover {
    transform: translateY(-2px) !important;
}

/* Focus effects */
input:focus,
select:focus,
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    #print-container,
    #print-container * {
        visibility: visible;
    }
    
    #print-container {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        background: white !important;
        color: black !important;
        font-family: Arial, sans-serif !important;
        padding: 20px !important;
        margin: 0 !important;
        z-index: 9999 !important;
    }
    
    .header,
    .quick-actions,
    .btn,
    .modal,
    .floating-reset-btn,
    .pwa-install-banner,
    .pwa-update-banner,
    .offline-indicator,
    .toast {
        display: none !important;
    }
    
    .content {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
        break-inside: avoid;
    }
    
    .participant-result {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .results-section {
        display: block !important;
    }
    
    .total-summary {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .participant-result::before {
        display: none;
    }
    
    .remove-btn {
        display: none !important;
    }
    
    .order-item input[type="checkbox"] {
        display: none !important;
    }
    
    .order-item.selected {
        background: #f0f0f0 !important;
        border: 1px solid #000 !important;
    }
    
    .order-item.selected .name {
        font-weight: bold;
    }
    
    .order-item.selected .price {
        font-weight: bold;
    }
    
    .order-item.selected .name::before {
        content: "✓ ";
        font-weight: bold;
    }
    
    .order-item:not(.selected) {
        display: none !important;
    }
}