@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

/* Login Screen */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f5f5f5;
}

.login-box {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-box .logo {
    max-width: 180px;
    margin-bottom: 20px;
}

.login-box h1 {
    font-size: 24px;
    color: #06b6d4;
    margin-bottom: 15px;
}

.login-box p {
    color: #666;
    margin-bottom: 25px;
}

.login-button {
    background-color: #06b6d4;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
    width: 100%;
}

.login-button:hover {
    background-color: #0891b2;
}

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

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background-color: white;
}

.app-header .logo {
    max-width: 150px;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-email {
    color: #555;
    font-size: 14px;
}

.logout-button {
    background-color: transparent;
    color: #06b6d4;
    border: 1px solid #06b6d4;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-button:hover {
    background-color: #06b6d4;
    color: white;
}

.app-main {
    padding: 20px 0;
}

/* Form Styles */
.form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.form-container h2 {
    font-size: 20px;
    color: #06b6d4;
    margin-bottom: 25px;
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
}

.form-section h3 {
    font-size: 16px;
    color: #555;
    margin-bottom: 15px;
    font-weight: 600;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group.full-width {
    width: 100%;
    flex-basis: 100%;
}

.form-group.service-desc {
    flex: 3;
}

.form-group.hours-group, .form-group.rate-group, .form-group.remove-group {
    flex: 1;
    min-width: 80px;
}

.form-group label {
    display: block;
    color: #555;
    font-size: 12px;
    margin-bottom: 5px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.form-group textarea {
    resize: vertical;
}

.line-item {
    padding: 10px;
    border-radius: 4px;
    background-color: #f9f9f9;
    margin-bottom: 10px;
}

.add-button, .remove-item {
    background-color: transparent;
    border: none;
    color: #06b6d4;
    cursor: pointer;
    padding: 5px;
    font-size: 13px;
    transition: color 0.3s;
}

.add-button {
    margin-bottom: 20px;
    display: block;
}

.add-button:hover, .remove-item:hover {
    color: #0891b2;
}

.remove-item {
    margin-top: 30px;
}

.remove-item:disabled {
    color: #ccc;
    cursor: not-allowed;
}

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

.primary-button {
    background-color: #06b6d4;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 25px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
}

.primary-button:hover {
    background-color: #0891b2;
}

/* Invoice Preview Styles */
.invoice-preview-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.invoice-preview {
    background-color: white;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    position: relative;
    border-radius: 8px;
}

.preview-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 2;
}

.preview-button {
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.preview-button:hover {
    background-color: #0052a3;
}

.preview-button.close {
    background-color: #ef4444;
}

/* Invoice Styles */
.invoice-container {
    background-color: white;
    padding: 40px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.logo-container {
    flex: 0 0 200px;
}

.logo-container img {
    max-width: 100%;
    height: auto;
}

.invoice-title {
    text-align: right;
}

.invoice-title h1 {
    color: #0066cc;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 20px 0;
    letter-spacing: 1px;
}

.invoice-details {
    color: #4b5563;
}

.detail-row {
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-row .label {
    color: #0066cc;
    margin-right: 8px;
    font-weight: 500;
}

.detail-row .value {
    font-weight: 500;
    color: #333;
}

.invoice-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    gap: 40px;
}

.info-section {
    flex: 1;
}

.info-section h3 {
    color: #0066cc;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-content {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

.info-content p {
    margin: 0 0 4px 0;
}

.company-name, .client-name {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
}

.service-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.service-table th {
    background-color: #0066cc;
    color: white;
    font-weight: 500;
    text-align: left;
    padding: 12px 16px;
    font-size: 14px;
}

.service-table td {
    padding: 12px 16px;
    color: #4b5563;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.service-col {
    width: 60%;
}

.hours-col {
    width: 20%;
}

.rate-col {
    width: 20%;
}

.service-desc {
    color: #111827;
    font-weight: 500;
}

.hours, .rate {
    text-align: right;
}

.totals-section {
    margin: 30px 0;
    padding: 20px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #4b5563;
}

.total-row .amount {
    font-weight: 600;
    color: #111827;
}

.total-row.grand-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #e5e7eb;
    font-size: 16px;
    font-weight: 700;
}

.total-row.grand-total span {
    color: #0066cc;
}

.notes-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.notes-section h3 {
    color: #0066cc;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.notes-section p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

.notes-section p strong {
    color: #0066cc;
}

.invoice-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.invoice-footer p {
    margin: 0 0 8px 0;
}

.company-info {
    color: #0066cc;
    font-weight: 500;
}

.generated, .invoice-id {
    font-size: 12px;
    color: #9ca3af;
}

/* Print Styles */
@media print {
    @page {
        size: letter portrait;
        margin: 0.5cm;
    }
    
    body {
        background-color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    .invoice-container {
        box-shadow: none;
        margin: 0;
        padding: 20px;
        width: 100%;
        max-width: none;
    }
    
    .preview-controls {
        display: none;
    }
    
    .invoice-preview {
        box-shadow: none;
        max-height: none;
        overflow: visible;
    }
    
    .service-table th {
        background-color: #0066cc !important;
        color: white !important;
    }
    
    .service-table {
        page-break-inside: avoid;
    }
    
    .totals-section {
        page-break-inside: avoid;
    }
    
    .notes-section {
        page-break-inside: avoid;
    }
    
    .invoice-footer {
        page-break-inside: avoid;
    }
}

/* Security Notification Styles */
.security-notification {
    background-color: #eef2ff;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.security-notification.warning {
    background-color: #fff7ed;
    border-left-color: #f97316;
    color: #9a3412;
}

.security-notification.error {
    background-color: #fef2f2;
    border-left-color: #ef4444;
    color: #b91c1c;
}

.security-notification.success {
    background-color: #f0fdf4;
    border-left-color: #22c55e;
    color: #166534;
}

.security-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Secure Elements */
.secure-badge {
    display: inline-flex;
    align-items: center;
    background-color: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    color: #166534;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.secure-badge .lock-icon {
    width: 10px;
    height: 10px;
}

/* Rate Limit Indicator */
.rate-limit-indicator {
    display: block;
    background-color: #f5f5f5;
    border-radius: 4px;
    padding: 10px;
    margin-top: 20px;
    font-size: 12px;
    color: #555;
}

.rate-limit-progress {
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.rate-limit-bar {
    height: 100%;
    background-color: #06b6d4;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.rate-limit-bar.warning {
    background-color: #f97316;
}

.rate-limit-bar.critical {
    background-color: #ef4444;
}

/* Session Security */
.session-info {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.session-timer {
    font-weight: 500;
}

/* Security Validation Indicators */
.input-validated {
    border-color: #22c55e !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2322c55e' viewBox='0 0 16 16'%3E%3Cpath d='M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 32px !important;
}

.input-error {
    border-color: #ef4444 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23ef4444' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z'/%3E%3Cpath d='M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 32px !important;
}

.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.input-error + .error-message {
    display: block;
}

/* Audit Log */
.audit-log {
    font-size: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    background-color: #f9fafb;
    margin-top: 20px;
}

.audit-log-entry {
    padding: 5px 0;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

.audit-log-entry:last-child {
    border-bottom: none;
}

.audit-timestamp {
    color: #6b7280;
    flex-shrink: 0;
}

.audit-action {
    color: #1f2937;
}

.audit-action.critical {
    color: #ef4444;
}

/* Portal Styles */
#portal-dashboard {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

#portal-dashboard h2 {
    font-size: 24px;
    color: #06b6d4;
    margin-bottom: 10px;
}

#portal-dashboard p {
    color: #555;
    margin-bottom: 30px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.app-card {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.app-icon {
    font-size: 32px;
    margin-bottom: 15px;
}

.app-card h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.app-card p {
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
}

.app-launch-btn {
    background-color: #06b6d4;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
}

.app-launch-btn:hover {
    background-color: #0891b2;
}

.coming-soon {
    opacity: 0.7;
    position: relative;
}

.coming-soon-badge {
    background-color: #f59e0b;
    color: white;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    position: absolute;
    top: 15px;
    right: 15px;
}

.app-navigation {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px;
}

.back-button {
    background-color: transparent;
    color: #06b6d4;
    border: 1px solid #06b6d4;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 15px;
}

.back-button:hover {
    background-color: #06b6d4;
    color: white;
}

/* Update existing styles to work with portal */
#invoice-generator h2 {
    font-size: 20px;
    color: #06b6d4;
    margin-bottom: 5px;
}

/* Usage Indicator */
.usage-indicator {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.usage-text {
    font-size: 12px;
    color: #555;
    margin-bottom: 5px;
}

.usage-bar {
    height: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

.usage-progress {
    height: 100%;
    background-color: #06b6d4;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-progress.warning {
    background-color: #f59e0b;
}

.usage-progress.critical {
    background-color: #ef4444;
}

.app-launch-btn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.app-launch-btn.disabled:hover {
    background-color: #ccc;
}

/* Update for Portal UI */
.form-container h2 {
    font-size: 20px;
    color: #06b6d4;
    margin-bottom: 25px;
} 