/* styles.css - Custom styles for Zenith Bill Splitter */

/* CSS Variables */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #6c757d;
    --secondary-hover: #545b62;
    --success-color: #28a745;
    --success-hover: #1e7e34;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
    --warning-color: #ffc107;
    --warning-hover: #e0a800;
    --info-color: #17a2b8;
    --info-hover: #138496;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    --black: #000000;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 0.75rem;
    --transition: all 0.15s ease-in-out;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-tertiary: #404040;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --text-muted: #808080;
        --border-color: #404040;
    }
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f4f8; /* Light background for the page */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Add user-select: none to specific elements that need it */
.cart-item,
.btn,
.settings-button,
.language-flag-modal,
.currency-flag-modal,
.currency-option-modal,
.cart-tab-button,
.decrease-quantity-button,
.increase-quantity-button,
.remove-item-button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ensure form inputs are selectable */
.form-input,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.spa-bg {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

.drawer {
    transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
    transform: translateX(100%); /* Start off-screen */
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
}

.drawer-open {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transform: translateX(0);
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Custom component styles from globals.css that might be relevant for cart/split */
.tab-active { /* For active tabs in cart drawer */
    background-color: white !important;
    color: #4a5568 !important; /* spa-600 equivalent */
}

.cart-item {
    transition: all 0.2s ease-in-out;
}

.cart-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Basic button styling if not using Tailwind extensively for them */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background-color: #f6ad55; /* amber-400 */
    color: #2d3748; /* spa-900 */
}

.btn-primary:hover {
    background-color: #ed8936; /* amber-500 */
}

.btn-secondary {
    background-color: #e2e8f0; /* gray-300 */
    color: #2d3748; /* gray-800 */
}

.btn-secondary:hover {
    background-color: #cbd5e0; /* gray-400 */
}

/* Settings Modal Styles */
.language-flag-modal, .currency-flag-modal {
    width: 48px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background-color: #f7fafc;
    -webkit-tap-highlight-color: transparent;
}

.language-flag-modal:hover, .currency-flag-modal:hover {
    transform: scale(1.05);
    background-color: #edf2f7;
}

.language-flag-modal.active, .currency-flag-modal.active {
    border-color: #f6ad55;
    transform: scale(1.05);
    background-color: #fef5e7;
}

.currency-option-modal {
    padding: 0.5rem 1rem;
    background-color: #f7fafc;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
    font-weight: 500;
}

.currency-option-modal:hover {
    background-color: #edf2f7;
}

.currency-option-modal.active {
    background-color: #f6ad55;
    color: #2d3748;
    border-color: #f6ad55;
}

/* Settings Button in Cart Header */
.settings-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.settings-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.empty-state-description {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.8;
}

/* Add Item Section */
.add-item-section {
    margin-top: 24px;
    padding: 20px;
    background: rgba(55, 65, 81, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.add-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.add-item-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
}

.form-input {
    padding: 12px 16px;
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(55, 65, 81, 0.5);
    color: #ffffff;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.add-item-button {
    padding: 12px 24px;
    background: #f59e0b;
    color: #1f2937;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.add-item-button:hover {
    background: #d97706;
}

/* Cart Items */
.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(55, 65, 81, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(75, 85, 99, 0.3);
    margin-bottom: 12px;
}

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

/* Quantity Controls */
.decrease-quantity-button,
.increase-quantity-button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #4b5563;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.decrease-quantity-button:hover,
.increase-quantity-button:hover {
    background: #6b7280;
}

.decrease-quantity-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.remove-item-button {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.remove-item-button:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .drawer {
        width: 100% !important;
    }
    
    .empty-state {
        padding: 1.5rem 1rem;
    }
    
    .empty-state-icon {
        font-size: 3rem;
    }
    
    .add-item-section {
        padding: 1rem;
    }
    
    .language-flag-modal, .currency-flag-modal {
        width: 40px;
        height: 28px;
        font-size: 16px;
    }
    
    .currency-option-modal {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Touch-friendly button sizes */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .decrease-quantity-button,
    .increase-quantity-button,
    .decrease-assign-qty,
    .increase-assign-qty {
        min-width: 32px;
        min-height: 32px;
    }
    
    .settings-button {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Orders Tab Styles */
.orders-container {
    padding: 0;
}

.orders-header {
    margin-bottom: 20px;
}

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

.empty-orders {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-orders .empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-orders h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    font-weight: 500;
}

.empty-orders p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.8;
}

.order-card {
    background: rgba(55, 65, 81, 0.5);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(75, 85, 99, 0.3);
    transition: all 0.3s ease;
}

.order-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.order-info {
    flex: 1;
}

.order-date {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 4px;
}

.order-total {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
}

.order-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.order-detail-item {
    display: flex;
    flex-direction: column;
}

.order-detail-label {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-detail-value {
    font-size: 0.9rem;
    color: #ffffff;
    font-weight: 500;
}

.order-items {
    margin-bottom: 12px;
}

.order-items-title {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-name {
    font-size: 0.8rem;
    color: #ffffff;
}

.order-item-price {
    font-size: 0.8rem;
    color: #9ca3af;
    font-weight: 500;
}

.order-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

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

.modal-body {
    padding: 24px;
    color: var(--text-primary);
}

.modal-body p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 24px 24px;
    border-top: 1px solid var(--border-color);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.action-buttons .btn {
    flex: 1;
}

/* Responsive Design for Orders */
@media (max-width: 768px) {
    .orders-container {
        padding: 16px;
    }
    
    .order-card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .order-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .order-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .order-actions {
        justify-content: stretch;
    }
    
    .order-actions .btn {
        flex: 1;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* Tab Navigation */
.tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 16px;
}

.tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
}

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

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

.tab-icon {
    font-size: 16px;
}

.tab-text {
    font-size: 14px;
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow-y: auto;
}

.tab-pane {
    display: none;
    padding: 20px;
    height: 100%;
}

.tab-pane.active {
    display: block;
}

/* Cart Drawer Tabs */
.cart-tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: 20px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.cart-tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cart-tab-button.tab-active {
    background: #ffffff;
    color: #1f2937;
}

/* Make tabs container scrollable */
.cart-tab-button:first-child {
    margin-left: 0;
}

.cart-tab-button:last-child {
    margin-right: 0;
}

/* Tab container with horizontal scroll */
.flex.space-x-2 {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    gap: 8px;
    padding: 0 4px;
}

.flex.space-x-2::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

#confirm-modal {
    display: none;
}
#confirm-modal.flex {
    display: flex;
}
#confirm-modal .bg-white {
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
#confirm-modal .rounded-lg {
    border-radius: 1rem;
}
#confirm-modal .font-bold {
    font-weight: 700;
}
#confirm-modal .font-semibold {
    font-weight: 600;
}
#confirm-modal .text-xl {
    font-size: 1.25rem;
}
#confirm-modal .text-base {
    font-size: 1rem;
}
#confirm-modal .text-gray-700 {
    color: #374151;
}
#confirm-modal .text-gray-800 {
    color: #1f2937;
}
#confirm-modal .bg-amber-400 {
    background-color: #f6ad55;
}
#confirm-modal .bg-gray-200 {
    background-color: #e5e7eb;
}
#confirm-modal .hover\:text-gray-700:hover {
    color: #374151;
}
#confirm-modal .hover\:bg-gray-300:hover {
    background-color: #d1d5db;
}
#confirm-modal .hover\:bg-amber-500:hover {
    background-color: #f59e0b;
} 