/*
Theme Name: Ad Platform
Description: Frontend theme for Ad Platform business management dashboard
Version: 1.0
*/

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

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

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

/* Navigation */
.main-content {
    min-height: 100vh;
    padding-top: 32px; /* Account for WordPress admin bar */
}

/* Account for WordPress admin bar when logged in */
body.admin-bar .main-content {
    padding-top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .main-content {
        padding-top: 46px; /* WordPress admin bar is taller on mobile */
    }
}

/* Login Required Styles */
.login-required {
    text-align: center;
    padding: 100px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 50px auto;
    max-width: 500px;
}

.login-required h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 28px;
}

.login-required p {
    color: #666;
    margin-bottom: 15px;
    font-size: 16px;
}

.login-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}

/* Business Selector */
.business-selector {
    margin: 40px 0;
}

.business-selector h2 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.business-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.business-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.business-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.business-domain {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.business-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.metric {
    text-align: center;
}

.metric-value {
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
    display: block;
}

.metric-label {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.health-score {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
}

.health-score.excellent { background: #28a745; }
.health-score.good { background: #ffc107; color: #333; }
.health-score.fair { background: #fd7e14; }
.health-score.poor { background: #dc3545; }
.health-score.no-data { background: #6c757d; }

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.dashboard-widget {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.widget-title {
    font-size: 18px;
    color: #333;
    margin: 0;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.stat-trend {
    font-size: 11px;
    color: #28a745;
    margin-top: 2px;
}

/* Business Header */
.business-header {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.business-header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.business-header p {
    color: #666;
    margin: 5px 0;
}

.back-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    margin-top: 20px;
    display: inline-block;
}

.back-link:hover {
    text-decoration: underline;
}

/* Campaign List */
.campaign-list {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.campaign-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.campaign-item:last-child {
    border-bottom: none;
}

.campaign-info h4 {
    color: #333;
    margin-bottom: 5px;
}

.campaign-info p {
    color: #666;
    font-size: 14px;
}

.campaign-actions {
    display: flex;
    gap: 10px;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    color: white;
}

.btn-secondary {
    background: #6c757d;
}

.btn-success {
    background: #28a745;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* No Data States */
.no-businesses {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-businesses h3 {
    color: #333;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .business-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .business-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .campaign-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}