/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

/* Footer Styles */
.main-footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.page-header h1 {
    font-size: 2rem;
    color: #2d3748;
}

.subtitle {
    color: #718096;
    margin-top: 0.5rem;
}

.page-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 3rem;
    line-height: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
}

.stat-label {
    color: #718096;
    font-size: 0.875rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
}

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

.data-table thead {
    background: #f7fafc;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.data-table tbody tr:hover {
    background: #f7fafc;
}

.data-table .actions {
    display: flex;
    gap: 0.5rem;
}

/* Forms */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-container h2 {
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #718096;
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Checkboxes */
.checkbox-group {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #f7fafc;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-draft {
    background: #e2e8f0;
    color: #4a5568;
}

.status-sending {
    background: #bee3f8;
    color: #2c5282;
}

.status-completed {
    background: #c6f6d5;
    color: #22543d;
}

.status-paused {
    background: #fed7d7;
    color: #742a2a;
}

.status-pending {
    background: #fef5e7;
    color: #744210;
}

.status-sent {
    background: #c6f6d5;
    color: #22543d;
}

.status-failed {
    background: #fed7d7;
    color: #742a2a;
}

/* Campaign Details */
.campaign-details {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.campaign-header h2 {
    margin-bottom: 0.5rem;
}

.campaign-actions {
    display: flex;
    gap: 1rem;
}

.campaign-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

.campaign-content {
    margin-bottom: 2rem;
}

.campaign-content h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.email-preview {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    background: #f7fafc;
}

.email-subject {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.email-body {
    white-space: pre-wrap;
    line-height: 1.8;
}

.campaign-recipients h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s;
}

.progress-success {
    background: linear-gradient(90deg, #48bb78, #38a169);
}

.progress-warning {
    background: linear-gradient(90deg, #ed8936, #dd6b20);
}

.progress-danger {
    background: linear-gradient(90deg, #f56565, #e53e3e);
}

/* Info Box */
.info-box {
    background: #edf2f7;
    border-left: 4px solid #667eea;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.info-box h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.info-box ul {
    list-style-position: inside;
    color: #4a5568;
}

.info-box li {
    margin-bottom: 0.5rem;
}

/* Recent Section */
.recent-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: #2d3748;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.empty-state a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Scraper Results */
.scrape-results {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.results-summary {
    margin-bottom: 2rem;
}

.results-summary h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
}

.summary-label {
    font-weight: 500;
    color: #4a5568;
}

.summary-value {
    font-weight: 700;
    color: #2d3748;
}

.extracted-data h3 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-card {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.contact-card:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.contact-card input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.contact-info {
    flex: 1;
}

.contact-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.contact-field:last-child {
    margin-bottom: 0;
}

.field-icon {
    font-size: 1.25rem;
}

/* Search and Filter Section */
.search-filter-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-input-group {
    display: flex;
    gap: 0;
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-input-group::before {
    content: '🔍';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.5;
    pointer-events: none;
}

.search-input {
    flex: 1;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f7fafc;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: white;
}

.search-input::placeholder {
    color: #a0aec0;
}

.search-input-group .btn-primary {
    border-radius: 0 8px 8px 0;
    padding: 0.875rem 1.75rem;
    border: 2px solid transparent;
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: #f7fafc url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%234a5568" d="M1.41 0L6 4.59L10.59 0L12 1.41l-6 6l-6-6z"/></svg>') no-repeat right 0.75rem center;
    background-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    min-width: 180px;
}

.filter-select:hover {
    border-color: #cbd5e0;
    background-color: white;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background-color: white;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.pagination .btn {
    min-width: 100px;
}

.page-info {
    color: #4a5568;
    font-weight: 500;
    padding: 0 1rem;
    min-width: 150px;
    text-align: center;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    background: white;
}

.page-number:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.page-number.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    cursor: default;
}

.page-number.active:hover {
    transform: none;
}

.page-number.dots {
    border: none;
    cursor: default;
}

.page-number.dots:hover {
    transform: none;
    border-color: transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .campaign-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input-group {
        min-width: 100%;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination .btn {
        width: 100%;
    }
    
    .page-numbers {
        order: -1;
        width: 100%;
    }
    
    .page-info {
        width: 100%;
    }
    
    .filter-select {
        min-width: 100%;
    }
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-info {
    background: #bee3f8;
    color: #2c5282;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fecaca;
    color: #991b1b;
}
