* {
    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;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

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

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.nav-menu {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.nav-link.active {
    background: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.logout-btn {
    background: rgba(231, 76, 60, 0.8) !important;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.9) !important;
    transform: translateY(-2px);
}

.summary-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.summary-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.summary-card.positive {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-card.negative {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.summary-card h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.summary-card .amount {
    font-size: 1.5rem;
    font-weight: bold;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

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

.section-description {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-style: italic;
}

.form-container {
    margin-bottom: 25px;
}

.form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-row input, .form-row select {
    flex: 1;
    min-width: 120px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background-color: white;
}

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

.form-row button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.form-row button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.items-list {
    max-height: 600px;
    overflow-y: auto;
}

.item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease;
}

.item:hover {
    transform: translateX(5px);
    border-color: #667eea;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.item-details {
    color: #718096;
    font-size: 0.9rem;
}

.item-amount {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2d3748;
    margin-right: 15px;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.btn-edit, .btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.btn-edit {
    background: #4299e1;
    color: white;
}

.btn-delete {
    background: #f56565;
    color: white;
}

.btn-edit:hover, .btn-delete:hover {
    transform: scale(1.05);
}

.category-breakdown {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

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

.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.2s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.category-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.category-amounts {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.amount-label {
    color: #718096;
    font-size: 0.9rem;
}

.amount-value {
    font-weight: 600;
    color: #2d3748;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

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

.progress-fill.over-budget {
    background: linear-gradient(135deg, #f56565 0%, #f093fb 100%);
}

.payment-history {
    margin-top: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.payment-history h4 {
    margin-bottom: 10px;
    color: #4a5568;
    font-size: 0.9rem;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.payment-details {
    flex: 1;
}

.payment-amount {
    font-weight: 600;
    color: #2d3748;
}

.payment-date {
    font-size: 0.8rem;
    color: #718096;
}

.btn-add-payment {
    background: #48bb78;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.btn-add-payment:hover {
    transform: scale(1.05);
    background: #38a169;
}

/* 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-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-modal {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.close-modal:hover {
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="time"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background-color: white;
    box-sizing: border-box;
}

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

.form-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 12px;
}

.email-settings {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.email-settings h3 {
    color: #4a5568;
    margin-bottom: 15px;
    margin-top: 25px;
    font-size: 1.1rem;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.email-settings h3:first-child {
    margin-top: 0;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

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

.btn-secondary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-accent {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.status-container {
    margin-top: 20px;
}

.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.status-card {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.status-card h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
}

.status-card p {
    margin: 0;
    font-weight: 600;
}

.status-card small {
    display: block;
    margin-top: 5px;
    opacity: 0.8;
    font-size: 12px;
}

.status-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.status-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.status-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.status-info {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2d3748;
}

.instructions {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.instructions h3 {
    color: #4a5568;
    margin-bottom: 15px;
    margin-top: 25px;
}

.instructions h3:first-child {
    margin-top: 0;
}

.instructions ol, .instructions ul {
    color: #718096;
    line-height: 1.6;
}

.instructions li {
    margin-bottom: 8px;
}

.instructions code {
    background: #edf2f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: #e53e3e;
}

.instructions a {
    color: #667eea;
    text-decoration: none;
}

.instructions a:hover {
    text-decoration: underline;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.message-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.message-error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

.message-info {
    background: #bee3f8;
    color: #2a4365;
    border: 1px solid #90cdf4;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Single column layout for email settings */
.email-settings-page .main-content {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
      .form-row input, .form-row select, .form-row button {
        width: 100%;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .category-cards {
        grid-template-columns: 1fr;
    }
    
    .item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .item-actions {
        align-self: flex-end;
    }
}
