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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.section {
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #333;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Forms */
.form-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.form-btn:hover {
    transform: translateY(-1px);
}

.form-switch {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

.form-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.dashboard-header h2 {
    color: #333;
}

/* Upload Section */
.upload-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.upload-container h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.file-upload {
    position: relative;
    margin-bottom: 1.5rem;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 2rem;
    border: 2px dashed #667eea;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    background: #f0f3ff;
    border-color: #764ba2;
}

.file-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.file-text {
    color: #666;
    font-size: 1.1rem;
}

.upload-actions {
    display: flex;
    gap: 1rem;
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Receipts Grid */
.receipts-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.receipts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.receipt-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
    position: relative;
}

.receipt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.receipt-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.delete-icon {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    z-index: 10;
}

.delete-icon:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
    transform: scale(1.1);
}

.delete-icon:active {
    transform: scale(0.95);
}

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

.receipt-restaurant {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.receipt-total {
    font-weight: bold;
    color: #667eea;
    font-size: 1.2rem;
}

.receipt-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.receipt-items {
    color: #666;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-content.large {
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

/* Loading Spinner */
.spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1500;
    animation: slideUp 0.3s ease;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
        min-height: 100vh;
    }

    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section {
        padding: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .upload-actions {
        flex-direction: column;
    }

    .receipts-grid,
    .restaurants-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1rem;
    }
}

/* Bill Splitting Interface */
.split-step {
    margin-bottom: 2rem;
}

.split-step h3 {
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

/* People Management */
.people-input {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.people-input input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.people-input input:focus {
    outline: none;
    border-color: #667eea;
}

.people-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    min-height: 60px;
    padding: 1rem;
    border: 2px dashed #ddd;
    border-radius: 10px;
    background: #f8f9fa;
}

.person-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.person-tag .remove-person {
    background: rgba(255,255,255,0.3);
    border: none;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.person-tag .remove-person:hover {
    background: rgba(255,255,255,0.5);
}

/* Distribution Controls */
.distribution-controls {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.distribution-controls label {
    font-weight: 600;
    margin-right: 0.5rem;
    color: #333;
}

.distribution-controls select {
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
}

/* Items Assignment */
.items-assignment {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.items-list {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.item-card {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: grab;
    transition: all 0.3s ease;
}

.item-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.item-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

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

.item-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.item-price {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
}

.item-quantity {
    color: #666;
    font-size: 0.9rem;
}

.item-assigned {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666;
}

.item-assigned.has-assignment {
    color: #28a745;
    font-weight: 500;
}

/* People Columns */
.people-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.person-column {
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 1rem;
    min-height: 300px;
    transition: all 0.3s ease;
}

.person-column.drag-over {
    border-color: #667eea;
    background: #f0f3ff;
}

.person-column h4 {
    text-align: center;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
}

.person-total {
    text-align: center;
    font-weight: bold;
    color: #667eea;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 5px;
}

.assigned-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.assigned-item.shared {
    border-left: 4px solid #ffc107;
    background: #fff9e6;
}

.assigned-item-header {
    display: flex;
    justify-content: between;
    align-items: center;
}

.assigned-item-name {
    font-weight: 500;
    flex: 1;
}

.assigned-item-price {
    font-weight: bold;
    color: #667eea;
}

.shared-indicator {
    font-size: 0.8rem;
    color: #ffc107;
    margin-top: 0.25rem;
}

/* Split Results */
.split-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.person-result {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    border: 2px solid #ddd;
}

.person-result h4 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.2rem;
}

.person-total-amount {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
}

.person-breakdown {
    margin-bottom: 1rem;
}

.breakdown-line {
    display: flex;
    justify-content: between;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.breakdown-line.total {
    border-top: 2px solid #667eea;
    padding-top: 0.5rem;
    font-weight: bold;
    font-size: 1.1rem;
}

.person-items {
    margin-top: 1rem;
    min-height: 100px;
    border: 2px dashed transparent;
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.person-items.drag-over {
    border-color: #667eea;
    background: #f0f3ff;
}

.assigned-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.assigned-item.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.assigned-item.clickable:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateX(-2px);
}

.unassign-hint {
    color: #dc3545;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.assigned-item.clickable:hover .unassign-hint {
    opacity: 1;
}

.unassigned-badge {
    background: #ffc107;
    color: #212529;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.no-items {
    text-align: center;
    padding: 2rem;
    color: #28a745;
    font-weight: 600;
    font-size: 1.1rem;
    background: #f8fff9;
    border: 2px solid #d4edda;
    border-radius: 8px;
}

.person-items h5 {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.result-item {
    display: flex;
    justify-content: between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: #666;
}

.result-item.shared {
    color: #ffc107;
    font-style: italic;
}

/* Button Styles */
.btn-primary, .btn-secondary, .btn-success {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}


.split-method-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.method-option {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.method-option:hover {
    border-color: #667eea;
}

.method-option input[type="radio"] {
    display: none;
}

.method-option input[type="radio"]:checked + label {
    color: #667eea;
}

.method-option input[type="radio"]:checked {
    border-color: #667eea;
    background: #f0f3ff;
}

.method-option label {
    cursor: pointer;
    display: block;
}

.method-option h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.method-option p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.split-content {
    margin-top: 2rem;
}

.percentage-controls {
    display: grid;
    gap: 1rem;
    margin: 1rem 0;
}

.percentage-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

.percentage-control label {
    min-width: 120px;
    font-weight: 600;
}

.percentage-control input[type="range"] {
    flex: 1;
    margin: 0 1rem;
}

.percentage-control .percentage-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

.percentage-control .amount-value {
    min-width: 80px;
    text-align: right;
    font-weight: 600;
    color: #28a745;
}

.percentage-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin: 1rem 0;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.total-percentage {
    font-weight: 600;
    font-size: 1.1rem;
}

.remaining-amount {
    font-weight: 600;
    font-size: 1.1rem;
    color: #28a745;
}

.split-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

/* Restaurant History */
.restaurants-section {
    margin-bottom: 2rem;
}

.restaurants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.restaurant-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
    position: relative;
}

.restaurant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.restaurant-card.favorite {
    border: 2px solid #ffc107;
}

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

.restaurant-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.restaurants-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-weight: 500;
    color: #666;
}

.restaurant-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.favorite-star {
    color: #ffc107;
    font-size: 1.2rem;
    cursor: pointer;
}

.favorite-btn, .delete-restaurant-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.favorite-btn:hover, .delete-restaurant-btn:hover {
    background-color: rgba(0,0,0,0.05);
}

.delete-restaurant-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.restaurant-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
}

.stat-note {
    display: block;
    font-size: 0.7rem;
    color: #28a745;
    font-style: italic;
    margin-top: 0.2rem;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.tab-btn {
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #667eea;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block !important;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.section-description {
    color: #666;
    font-size: 0.9rem;
}

/* History Filters */
.history-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* History Actions */
.history-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.history-actions .btn-secondary,
.history-actions .btn-danger {
    min-width: 160px;
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Restaurant Visits Section */
.restaurant-visits-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

.visits-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.visits-header h4 {
    margin: 0;
    color: #333;
}

.visits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.visit-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.visit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.visit-date {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.visit-amount {
    font-size: 1.2rem;
    color: #28a745;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.visit-details {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.visit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.visit-actions .btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.restaurant-last-visit {
    color: #666;
    font-size: 0.9rem;
    text-align: center;
}

.restaurant-card-actions {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

.no-visits {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Empty State Styling */
.receipts-grid .empty-state,
.restaurants-grid .empty-state {
    grid-column: 1 / -1;
    text-align: center !important;
    padding: 3rem 2rem;
    color: #666;
    max-width: 500px;
    margin: 0 auto !important;
    width: 100%;
    display: block;
    justify-self: center;
}

.empty-state {
    text-align: center !important;
    padding: 3rem 2rem;
    color: #666;
    max-width: 500px;
    margin: 0 auto !important;
    width: 100%;
    display: block;
}

/* Force center alignment for restaurant history empty state */
#restaurantsList .empty-state {
    text-align: center !important;
    margin: 0 auto !important;
    display: block !important;
    width: 100% !important;
    max-width: 500px !important;
    grid-column: 1 / -1 !important;
    justify-self: center !important;
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0 auto !important;
    line-height: 1.5;
    text-align: center !important;
    display: block;
    width: 100%;
}

/* Responsive adjustments for bill splitting */
@media (max-width: 768px) {
    .people-input {
        flex-direction: column;
    }

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

    .distribution-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .items-assignment {
        grid-template-columns: 1fr;
    }

    .people-columns {
        grid-template-columns: 1fr;
    }

    .split-results {
        grid-template-columns: 1fr;
    }

    .split-actions {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary, .btn-success {
        margin-right: 0;
        margin-bottom: 1rem;
    }
}