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

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

.header-actions {
    position: relative;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    align-items: center;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    flex-shrink: 0;
}

h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

/* Menu Toggle Button */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    background: #e2e8f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 3px;
    padding: 8px;
}

.menu-toggle:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.hamburger {
    width: 18px;
    height: 2px;
    background: #4a5568;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.menu-toggle.active .hamburger:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

/* Overflow Menu */
.overflow-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    margin-top: 8px;
}

.overflow-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    text-align: left;
}

.menu-item:first-child {
    border-radius: 12px 12px 0 0;
}

.menu-item:last-child {
    border-radius: 0 0 12px 12px;
}

.menu-item:only-child {
    border-radius: 12px;
}

.menu-item:hover {
    background: #f7fafc;
    color: #2d3748;
}

.menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

main section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    margin-right: 6px;
    font-size: 18px;
    color: white;
    font-weight: bold;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: flex-end;
}

/* 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(5px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Results Styles */
.results {
    border-left: 4px solid #667eea;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.calculation-details {
    margin-bottom: 30px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span:first-child {
    font-weight: 600;
    color: #4a5568;
}

.detail-row span:last-child {
    color: #2d3748;
    font-weight: 500;
}

.split-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.split-item {
    text-align: center;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.split-item.lydia {
    background: linear-gradient(135deg, #fbb6ce, #f687b3);
    color: white;
}

.split-item.stefan {
    background: linear-gradient(135deg, #90cdf4, #63b3ed);
    color: white;
}

.split-item h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.split-item .amount {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
    width: 100%;
    line-height: 1.2;
    display: block;
}

.split-item .breakdown {
    font-size: 0.9rem;
    opacity: 0.9;
    text-align: center;
    width: 100%;
    line-height: 1.4;
    display: block;
}

/* History Styles */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-entry {
    padding: 20px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.history-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.history-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-date {
    font-weight: 600;
    color: #4a5568;
    font-size: 1.1rem;
}

.delete-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

.edit-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    opacity: 0.6;
    margin-right: 5px;
}

.edit-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

.entry-actions {
    display: flex;
    align-items: center;
}

.save-btn, .cancel-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.save-btn {
    color: #059669;
}

.save-btn:hover {
    background: rgba(5, 150, 105, 0.1);
    transform: scale(1.1);
}

.cancel-btn {
    color: #dc2626;
}

.cancel-btn:hover {
    background: rgba(220, 38, 38, 0.1);
    transform: scale(1.1);
}

.edit-actions {
    display: flex;
    align-items: center;
}

.history-entry.editing {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e6efff 100%);
}

.edit-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.edit-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.edit-row label {
    font-weight: 600;
    color: #4a5568;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-row input {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.edit-row input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.history-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    font-size: 14px;
    color: #718096;
    margin-bottom: 15px;
}

.split-display {
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
    margin-top: 15px;
}

.split-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
    color: #718096;
}

.split-amounts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.split-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
}

.lydia-split {
    background: linear-gradient(135deg, #fbb6ce, #f687b3);
    color: white;
}

.stefan-split {
    background: linear-gradient(135deg, #90cdf4, #63b3ed);
    color: white;
}

.split-amount .label {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.split-amount .amount {
    font-weight: 700;
    font-size: 16px;
}

.no-calculation {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 10px;
    border-top: 1px solid #e2e8f0;
    margin-top: 15px;
    font-size: 13px;
}

.no-entries {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 40px;
}

.hidden {
    display: none;
}

/* Custom Confirmation Dialog */
.confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirmation-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirmation-dialog {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    text-align: center;
}

.confirmation-overlay.show .confirmation-dialog {
    transform: scale(1) translateY(0);
}

.confirmation-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.confirmation-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
}

.confirmation-message {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 32px;
}

.confirmation-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirmation-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.confirmation-btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.confirmation-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.confirmation-btn-cancel {
    background: #e2e8f0;
    color: #4a5568;
}

.confirmation-btn-cancel:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        padding: 12px 16px;
        min-height: auto;
    }
    
    .header-actions {
        justify-content: flex-end;
        flex-shrink: 0;
        min-width: 0;
    }
    
    h1 {
        font-size: 1.1rem;
        min-width: 0;
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .split-summary {
        grid-template-columns: 1fr;
    }
    
    .split-amounts {
        grid-template-columns: 1fr;
    }
    
    .split-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .edit-form {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
    }
    
    .btn {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 0;
    }
    
    .btn-icon {
        margin-right: 3px;
        font-size: 14px;
    }
    
    .menu-toggle {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }
    
    .hamburger {
        width: 16px;
    }
    
    .form-dialog {
        padding: 20px;
        max-width: 95%;
        margin: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    header {
        padding: 10px 12px;
        gap: 6px;
    }
    
    h1 {
        font-size: 1rem;
    }
    
    .btn {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .btn-icon {
        margin-right: 2px;
        font-size: 12px;
    }
    
    .menu-toggle {
        width: 30px;
        height: 30px;
    }
    
    .hamburger {
        width: 14px;
    }
    
    main section {
        padding: 20px;
    }
}

/* Form Dialog Styles */
.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.form-overlay.show {
    opacity: 1;
    visibility: visible;
}

.form-dialog {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.form-overlay.show .form-dialog {
    transform: scale(1) translateY(0);
}

.form-header {
    margin-bottom: 24px;
    text-align: center;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
} 