/* Modal and Draft Management Styles */

.draft-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.draft-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.draft-modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s;
}

.draft-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1e3a8a;
}

.draft-modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #1e3a8a;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-modal:hover {
    color: #1e3a8a;
}

.draft-list {
    margin: 20px 0;
}

.draft-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.draft-item:hover {
    background-color: #f5f5f5;
}

.draft-item.auto-saved {
    border-left: 4px solid #10b981;
    background-color: #f0fdf4;
}

.draft-item.auto-saved:hover {
    background-color: #ecfdf5;
}

.draft-info {
    flex: 1;
}

.draft-name {
    font-weight: bold;
    color: #1e3a8a;
    margin-bottom: 5px;
}

.draft-meta {
    font-size: 12px;
    color: #666;
}

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

.draft-btn {
    padding: 6px 12px;
    border: 1px solid #1e3a8a;
    background: white;
    color: #1e3a8a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.draft-btn:hover {
    background: #1e3a8a;
    color: white;
}

.draft-btn.delete {
    border-color: #dc2626;
    color: #dc2626;
}

.draft-btn.delete:hover {
    background: #dc2626;
    color: white;
}

.save-draft-btn {
    background: #1e3a8a;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.save-draft-btn:hover {
    background: #1e5a8a;
}

.drafts-btn {
    background: white;
    color: #1e3a8a;
    border: 1px solid #1e3a8a;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.drafts-btn:hover {
    background: #f5f5f5;
}

.empty-drafts {
    text-align: center;
    padding: 40px;
    color: #666;
}

.storage-info {
    margin-top: 20px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.storage-bar {
    width: 100%;
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 5px;
}

.storage-used {
    height: 100%;
    background: #1e3a8a;
    transition: width 0.3s;
}

.storage-used.warning {
    background: #f59e0b;
}

.storage-used.critical {
    background: #dc2626;
}

/* Settings Form Styles */
.settings-form {
    max-width: 600px;
}

.settings-form .form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.settings-form .form-section h3 {
    margin-top: 0;
    color: #1e3a8a;
    border-bottom: 2px solid #1e3a8a;
    padding-bottom: 8px;
}

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

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

/* Print styles - hide all modals and UI elements when printing */
@media print {
    .draft-modal,
    .draft-modal-content,
    .settings-form,
    .close-modal,
    .menu-toggle,
    .new-invoice-toggle,
    .save-draft-toggle,
    .view-drafts-toggle {
        display: none !important;
    }
}