/* ========================================================================
   Custom Styles - Mail Merge Engine
   ======================================================================== */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

/* General */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

/* Cards */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-header {
    font-weight: 600;
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,0.03);
}

/* Buttons */
.btn {
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Alerts */
.alert {
    border-radius: 8px;
}

/* Footer */
.footer {
    margin-top: auto;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Code Preview */
.code-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
}

/* Email Preview */
.email-preview {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
}

/* Stats Cards */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Template Editor */
.template-editor {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

textarea.template-editor {
    min-height: 300px;
    resize: vertical;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .stat-card h2 {
        font-size: 2rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Utility Classes */
.opacity-50 {
    opacity: 0.5;
}

.text-monospace {
    font-family: 'Courier New', monospace;
}

.border-dashed {
    border-style: dashed !important;
}

/* Modal Enhancements */
.modal-header.bg-primary,
.modal-header.bg-success,
.modal-header.bg-info,
.modal-header.bg-warning,
.modal-header.bg-danger {
    color: white;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Badge Enhancements */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 500;
}

/* Form Controls */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Success/Error States */
.is-valid {
    border-color: var(--success-color) !important;
}

.is-invalid {
    border-color: var(--danger-color) !important;
}
