/* Custom styles for Facebook Ad Spend Tracker */

:root {
    --primary-color: #343a40;
    --secondary-color: #6c757d;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --light-bg: #f8f9fa;
    --dark-text: #333;
    --active-color: #6c757d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
}

.navbar-brand {
    font-weight: 600;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: none;
    padding: 1rem 1.5rem;
}

.list-group-item {
    border: none;
    padding: 12px 20px;
}

.list-group-item.active {
    background-color: var(--active-color);
    border-color: var(--active-color);
    color: white;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 20px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #212529;
    border-color: #212529;
}

.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-primary:focus-visible {
    background-color: #212529 !important;
    border-color: #212529 !important;
    box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5) !important;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5) !important;
}

.btn-outline-secondary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.text-primary {
    color: var(--primary-color) !important;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 10px 15px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(24, 119, 242, 0.25);
}

.table {
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 15px;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-top: 1px solid #f0f0f0;
}


.alert {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
}

.modal-content {
    border-radius: 12px;
    border: none;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.stats-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 5px;
}

/* Results Table Enhancements */
.results-table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-disabled {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

/* Currency formatting */
.currency {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Email search results */
.email-result {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: white;
}


.email-subject {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 5px;
}

.email-from {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.email-snippet {
    color: #777;
    font-size: 0.9rem;
    line-height: 1.4;
}

.transaction-data {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    font-size: 0.85rem;
}

/* Reconciliation results */
.match-card {
    border-left: 4px solid var(--success-color);
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 0 8px 8px 0;
}

.match-card .match-score {
    background: var(--success-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.no-matches {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-matches i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Platform Selection Cards */
.platform-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    height: 100%;
}

.platform-card:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #e3f2fd;
}

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

.platform-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

.platform-card .card-body {
    padding: 30px 20px;
    text-align: center;
}

.platform-card h6 {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.platform-card small {
    color: #666;
    font-size: 0.9rem;
}

/* Bulk search specific styles */
.email-result-compact {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    background: #f8f9fa;
}

.transaction-data-compact {
    margin-top: 8px;
    font-size: 0.8rem;
}

.transaction-data-compact .badge {
    font-size: 0.7rem;
}

/* Search mode toggle */
.btn-check:checked + .btn-outline-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Bulk search results cards */
.bulk-search-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
    background: white;
}

.bulk-search-card .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 12px 15px;
}

.bulk-search-card .card-body {
    padding: 15px;
}

.reference-code {
    font-family: 'Courier New', monospace;
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}