* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.nav-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.nav-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    border: none;
    background: transparent;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #6c757d;
}

.nav-tab.active {
    background: white;
    color: #4facfe;
    border-bottom: 3px solid #4facfe;
}

.nav-tab:hover {
    background: #e9ecef;
}

.tab-content {
    display: none;
    padding: 30px;
}

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

.shop-selector {
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.shop-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.shop-tab {
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.shop-tab.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-color: #4facfe;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.shop-tab .delete-shop {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: none;
}

.shop-tab:hover .delete-shop {
    display: block;
}

.add-shop-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-shop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(86, 171, 47, 0.4);
}

.form-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.form-section h3 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.3rem;
}

.form-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: end;
}

.form-group input, .form-group textarea {
    flex: 1;
    min-width: 150px;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group textarea {
    min-height: 60px;
    resize: vertical;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.add-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.transactions-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h3 {
    color: #495057;
    font-size: 1.3rem;
}

.total-due {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #495057;
    padding: 15px 25px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 5px 15px rgba(255, 154, 158, 0.3);
}

.sort-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.sort-btn {
    padding: 8px 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sort-btn.active {
    background: #4facfe;
    color: white;
    border-color: #4facfe;
}

.export-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(116, 185, 255, 0.4);
}

.transaction-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.transaction-item:hover {
    border-color: #4facfe;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.transaction-info {
    flex: 1;
    min-width: 200px;
}

.transaction-date {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

.transaction-amount {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff6b6b;
}

.transaction-note {
    margin-top: 10px;
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

.delete-btn, .paid-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.paid-btn {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
}

.delete-btn {
    background: linear-gradient(135deg, #fd79a8 0%, #fdcb6e 100%);
    color: white;
}

.paid-btn:hover, .delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin: 15px 0;
    font-size: 16px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
}

.modal-btn.confirm {
    background: #4facfe;
    color: white;
}

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

.history-item {
    background: #e8f5e8;
    border-left: 4px solid #28a745;
}

.history-item .transaction-amount {
    color: #28a745;
}

.paid-date {
    font-size: 0.85rem;
    color: #28a745;
    font-weight: 500;
    margin-top: 5px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }

    .header {
        padding: 20px;
    }

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

    .tab-content {
        padding: 20px;
    }

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

    .form-group input, .form-group textarea {
        min-width: auto;
    }

    .transaction-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .shop-tabs {
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        text-align: center;
    }

    .sort-controls {
        justify-content: center;
    }

    .paid-btn, .delete-btn {
        margin-left: 0;
        margin-top: 10px;
    }
}