/**
 * Reseller Dashboard Styles
 * For QR Code Generator Business Manager Addon
 * 
 * @package QRCG_Business_Manager
 * @version 1.1.0
 */

/* Main Container */
.reseller-dashboard {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

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

.stat-card {
    background: #fff;
    padding: 25px;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    margin: 0 0 15px 0;
    color: #50575e;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #2271b1;
    margin: 0;
    line-height: 1;
}

/* Sections */
.reseller-section {
    background: #fff;
    padding: 30px;
    margin: 25px 0;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.reseller-section h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #1d2327;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f1;
    padding-bottom: 10px;
}

.reseller-section h3 {
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 15px;
}

/* Form Styling */
.reseller-order-form {
    max-width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.form-group .required {
    color: #d63638;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Pricing Preview */
#pricing-preview {
    background: linear-gradient(135deg, #f0f6fc 0%, #e6f1fb 100%);
    border: 2px solid #2271b1;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#pricing-preview h4 {
    margin: 0 0 15px 0;
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #c3c4c7;
    padding-bottom: 10px;
}

/* Pricing Breakdown Table */
.pricing-breakdown {
    width: 100%;
    margin-top: 10px;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

.pricing-breakdown td {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f1;
    font-size: 14px;
}

.pricing-breakdown td:first-child {
    font-weight: 600;
    color: #50575e;
    width: 50%;
}

.pricing-breakdown td:last-child {
    text-align: right;
    font-weight: 500;
    color: #1d2327;
}

.pricing-breakdown .discount-row td {
    color: #00a32a;
    background: #f0fdf4;
}

.pricing-breakdown .total-row {
    background: #f6f7f7;
    font-size: 16px;
}

.pricing-breakdown .total-row td {
    padding: 15px;
    font-weight: 700;
    color: #1d2327;
    border-bottom: none;
}

.pricing-breakdown .commission-row td {
    background: #f0f6fc;
    color: #2271b1;
    font-weight: 600;
    border-bottom: none;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fcf9e9;
    color: #996800;
    border: 1px solid #dba617;
}

.status-processing {
    background: #e6f5ff;
    color: #0073aa;
    border: 1px solid #2271b1;
}

.status-completed {
    background: #edfaef;
    color: #007017;
    border: 1px solid #00a32a;
}

.status-cancelled {
    background: #fef1f1;
    color: #8a0000;
    border: 1px solid #d63638;
}

/* Orders Table */
.orders-filter {
    margin-bottom: 20px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.orders-filter label {
    font-weight: 600;
    color: #1d2327;
}

.orders-filter select {
    min-width: 150px;
}

/* Export Controls */
.export-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
}

.export-controls label {
    font-weight: 600;
    color: #1d2327;
}

.export-controls input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 30px;
    color: #50575e;
    font-style: italic;
}

.loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f0f0f1;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error {
    color: #d63638;
    padding: 15px;
    background: #fef1f1;
    border: 1px solid #d63638;
    border-radius: 4px;
    margin: 10px 0;
}

/* Success State */
.success {
    color: #007017;
    padding: 15px;
    background: #edfaef;
    border: 1px solid #00a32a;
    border-radius: 4px;
    margin: 10px 0;
}

/* Buttons */
.button-large {
    padding: 10px 20px !important;
    font-size: 15px !important;
}

.view-order,
.print-order {
    margin: 0 2px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .reseller-dashboard {
        max-width: 100%;
    }
}

@media (max-width: 782px) {
    .reseller-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .export-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .reseller-section {
        padding: 20px;
    }
    
    .wp-list-table {
        font-size: 13px;
    }
    
    .wp-list-table td,
    .wp-list-table th {
        padding: 8px 5px;
    }
}

@media (max-width: 600px) {
    .reseller-dashboard {
        padding: 0 10px;
    }
    
    .reseller-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .button-small {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }
}

/* Print Styles */
@media print {
    .reseller-dashboard {
        max-width: 100%;
    }
    
    .orders-filter,
    .export-controls,
    .button,
    .submit {
        display: none !important;
    }
    
    .reseller-section {
        page-break-inside: avoid;
        border: 1px solid #000;
        box-shadow: none;
    }
}