/* Invoice Tool Pro - Professional Glassmorphism Design */

:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --accent-color: #059669;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.25);
    --card-border: rgba(255, 255, 255, 0.18);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #ffffff;
    
    --shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --shadow-heavy: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
    
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-light);
    padding: 30px;
}

.header-content h1 {
    color: var(--text-light);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 300;
}

.header-actions {
    display: flex;
    gap: 15px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--primary-color);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success-color);
    color: var(--text-light);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-light);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Section Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    color: var(--text-light);
    font-size: 1.8rem;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-controls select,
.filter-controls input {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 0.9rem;
}

.filter-controls input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Invoices Grid */
.invoices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.invoice-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-light);
    padding: 25px;
    transition: var(--transition);
    cursor: pointer;
}

.invoice-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

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

.invoice-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-light);
}

.invoice-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-draft { background: rgba(156, 163, 175, 0.2); color: #9ca3af; }
.status-sent { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.status-paid { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.status-overdue { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.invoice-client {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-bottom: 10px;
}

.invoice-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 10px;
}

.invoice-date {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-light);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.summary-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.5rem;
}

.summary-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 5px;
}

.summary-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Form Styles */
.invoice-form {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-light);
    padding: 30px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    color: var(--text-light);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
}

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

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

.form-group label {
    display: block;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

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

/* Client Selector */
.client-selector {
    display: flex;
    gap: 10px;
}

.client-selector select {
    flex: 1;
}

/* Items Table */
.items-table {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.table-body {
    padding: 10px 20px;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

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

.item-row input {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 0.85rem;
}

.item-total {
    color: var(--text-light);
    font-weight: 600;
    text-align: right;
}

.remove-item-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.remove-item-btn:hover {
    background: #dc2626;
}

/* Totals Container */
.totals-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: var(--text-light);
    font-size: 1rem;
}

.total-final {
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    margin-top: 10px;
    padding-top: 15px;
    font-size: 1.2rem;
    font-weight: 700;
}

/* Creator Actions */
.creator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-light);
    padding: 25px;
}

.creator-header h2 {
    color: var(--text-light);
    font-size: 1.8rem;
    font-weight: 600;
}

.creator-actions {
    display: flex;
    gap: 15px;
}

/* Clients Grid */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.client-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-light);
    padding: 25px;
    transition: var(--transition);
}

.client-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.client-name {
    color: var(--text-light);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.client-contact {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
}

.client-actions {
    display: flex;
    gap: 10px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-heavy);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Settings Sections */
.settings-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h4 {
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .table-header,
    .item-row {
        grid-template-columns: 2fr 80px 80px 80px auto;
        gap: 10px;
    }
    
    .creator-actions {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .invoices-grid {
        grid-template-columns: 1fr;
    }
    
    .clients-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        display: none;
    }
    
    .item-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .creator-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .creator-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .invoice-form {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.invoice-card,
.client-card,
.summary-card {
    animation: slideIn 0.4s ease-out;
}

/* Loading State */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .header-actions,
    .creator-actions,
    .btn,
    .filter-controls {
        display: none !important;
    }
    
    .invoice-form {
        background: white;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}