/* Facebook Ads Library Analyzer - Main Stylesheet */

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

:root {
    --primary-color: #0066cc;
    --secondary-color: #667eea;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --light-bg: #f9fafb;
    --border-color: #e5e7eb;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
header {
    background: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

/* Main Content */
.content {
    padding-bottom: 40px;
}

.page-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 30px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card.blue {
    border-left-color: #3b82f6;
}

.stat-card.purple {
    border-left-color: #a855f7;
}

.stat-card.green {
    border-left-color: #10b981;
}

.stat-card.red {
    border-left-color: #ef4444;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    font-size: 24px;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-light);
}

.card-content {
    padding: 20px;
}

/* Search Section */
.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: #0052a3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

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

/* Table */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--light-bg);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

tbody tr:hover {
    background: var(--light-bg);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.badge-secondary {
    background: var(--light-bg);
    color: var(--text-dark);
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.badge-orange {
    background: #fed7aa;
    color: #92400e;
}

.badge-yellow {
    background: #fef3c7;
    color: #78350f;
}

.badge-blue {
    background: #dbeafe;
    color: #1e3a8a;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 6px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-light);
}

.pagination-buttons {
    display: flex;
    gap: 10px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.empty-state-text {
    color: var(--text-light);
    font-size: 14px;
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 24px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px 12px;
    }

    .pagination {
        flex-direction: column;
        gap: 15px;
    }

    .search-section {
        flex-direction: column;
    }
}

/* Footer */
footer {
    background: white;
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}
