/**
 * PIE Ads Pro Advertiser Portal Styles
 * Modern, responsive design for the advertiser portal
 */

/* Portal Container */
.pieads-portal-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Registration Form */
#pieads-advertiser-registration {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#pieads-advertiser-registration h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input:invalid {
    border-color: #e74c3c;
}

#advertiser-registration-form button[type="submit"] {
    width: 100%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

#advertiser-registration-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

#registration-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

#registration-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#registration-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Dashboard */
#pieads-advertiser-dashboard {
    background: #f8f9fa;
    min-height: 600px;
}

#pieads-advertiser-dashboard h2 {
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 32px;
    font-weight: 700;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    background: white;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 0;
}

.tab-button {
    flex: 1;
    padding: 16px 20px;
    background: #ecf0f1;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #d5dbdb;
    color: #2c3e50;
}

.tab-button.active {
    background: white;
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 500px;
}

.tab-content.active {
    display: block;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin: 0;
}

/* Chart Container */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    height: 350px;
}

.chart-container canvas {
    max-height: 300px;
    height: 280px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Campaign and Ads Lists */
.campaigns-header,
.ads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.campaigns-header h3,
.ads-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

#campaigns-list,
#ads-list {
    display: grid;
    gap: 20px;
}

.campaign-card,
.ad-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.campaign-card:hover,
.ad-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.campaign-card h4,
.ad-card h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.campaign-meta,
.ad-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #7f8c8d;
}

.campaign-actions,
.ad-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

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

.status-pending {
    background: #cce5ff;
    color: #004085;
}

/* Profile Form */
#profile-form {
    max-width: 600px;
}

#profile-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Billing Section */
#billing-info {
    display: grid;
    gap: 20px;
}

.billing-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.billing-card h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #7f8c8d;
    font-size: 16px;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #ecf0f1;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .pieads-portal-container {
        padding: 10px;
    }
    
    #pieads-advertiser-registration {
        padding: 20px;
        margin: 10px;
    }
    
    .dashboard-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: none;
        border-right: 3px solid transparent;
    }
    
    .tab-button.active {
        border-right-color: #3498db;
        border-bottom-color: transparent;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .campaigns-header,
    .ads-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .campaign-meta,
    .ad-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    #profile-form .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 28px;
    }
    
    .campaign-actions,
    .ad-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pieads-portal-container {
        background: #1a1a1a;
        color: #e1e1e1;
    }
    
    #pieads-advertiser-registration,
    .tab-content,
    .campaign-card,
    .ad-card,
    .billing-card {
        background: #2d2d2d;
        color: #e1e1e1;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #3d3d3d;
        border-color: #555;
        color: #e1e1e1;
    }
    
    .tab-button {
        background: #3d3d3d;
        color: #b1b1b1;
    }
    
    .tab-button.active {
        background: #2d2d2d;
        color: #3498db;
    }
}