/**
 * Chatly Affiliates - Frontend Styles
 */

/* Application Form */
.chatly-aff-application-form {
    max-width: 600px;
    margin: 0 auto;
}

.chatly-aff-application-form h3 {
    margin-bottom: 10px;
}

.chatly-aff-form-row {
    margin-bottom: 20px;
}

.chatly-aff-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.chatly-aff-form-row .required {
    color: #dc3545;
}

.chatly-aff-form-row input[type="text"],
.chatly-aff-form-row input[type="email"],
.chatly-aff-form-row input[type="url"],
.chatly-aff-form-row select,
.chatly-aff-form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.chatly-aff-form-row input:disabled {
    background: #f5f5f5;
    color: #666;
}

.chatly-aff-form-row small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.chatly-aff-form-row small a {
    color: #0073aa;
}

/* Inline form columns */
.chatly-aff-form-row-inline {
    display: flex;
    gap: 15px;
}

.chatly-aff-form-col {
    flex: 1;
}

.chatly-aff-form-col label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.chatly-aff-form-col input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Address section */
.chatly-aff-address-fields h4 {
    margin: 0 0 5px;
}

.chatly-aff-address-note {
    margin: 0 0 15px;
    color: #666;
    font-size: 13px;
}

/* File input */
.chatly-aff-form-row input[type="file"] {
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
}

.chatly-aff-form-row input[type="file"]:hover {
    border-color: #0073aa;
    background: #f0f7fc;
}

/* Form sections */
.chatly-aff-form-section {
    margin-bottom: 10px;
}

.chatly-aff-form-section h4 {
    margin: 0 0 15px;
    color: #1d2327;
}

/* Login link */
.chatly-aff-login-link {
    margin: 0 0 25px;
    padding: 12px 15px;
    background: #f0f7fc;
    border-left: 4px solid #0073aa;
    border-radius: 0 4px 4px 0;
    color: #1d2327;
}

.chatly-aff-login-link a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.chatly-aff-login-link a:hover {
    text-decoration: underline;
}

.chatly-aff-submit-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.chatly-aff-submit-btn:hover {
    background: #005a87;
}

.chatly-aff-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chatly-aff-message {
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

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

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

/* Dashboard */
.chatly-aff-dashboard {
    max-width: 900px;
    margin: 0 auto;
}

.chatly-aff-dashboard h3 {
    margin-bottom: 20px;
}

.chatly-aff-dashboard h4 {
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

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

.chatly-aff-stat-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.chatly-aff-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
}

.chatly-aff-stat-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* Earnings Grid */
.chatly-aff-earnings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.chatly-aff-earning-box {
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.chatly-aff-earning-box.pending {
    background: #fff8e6;
    border: 1px solid #ffc107;
}

.chatly-aff-earning-box.approved {
    background: #e8f5e9;
    border: 1px solid #4caf50;
}

.chatly-aff-earning-box.paid {
    background: #e3f2fd;
    border: 1px solid #2196f3;
}

.chatly-aff-earning-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

.chatly-aff-earning-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-top: 5px;
}

.chatly-aff-earning-box small {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

/* Link Copy Box */
.chatly-aff-link-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.chatly-aff-link-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.chatly-aff-link-copy {
    display: flex;
    gap: 10px;
}

.chatly-aff-link-copy input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

.chatly-aff-copy-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.chatly-aff-copy-btn:hover {
    background: #005a87;
}

.chatly-aff-copy-btn.copied {
    background: #28a745;
}

.chatly-aff-link-box small {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 12px;
}

/* Referrals Table */
.chatly-aff-referrals-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.chatly-aff-referrals-table th,
.chatly-aff-referrals-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.chatly-aff-referrals-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.chatly-aff-referrals-table tr:hover {
    background: #f8f9fa;
}

/* Status in table */
.chatly-aff-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.chatly-aff-status-pending {
    background: #fff8e6;
    color: #9a6700;
}

.chatly-aff-status-approved {
    background: #e8f5e9;
    color: #2e7d32;
}

.chatly-aff-status-paid {
    background: #e3f2fd;
    color: #1565c0;
}

.chatly-aff-status-rejected {
    background: #ffebee;
    color: #c62828;
}

/* No Data */
.chatly-aff-no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Account Section */
.chatly-aff-account-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.chatly-aff-account-section p {
    margin: 5px 0;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .chatly-aff-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chatly-aff-earnings-grid {
        grid-template-columns: 1fr;
    }
    
    .chatly-aff-link-copy {
        flex-direction: column;
    }
    
    .chatly-aff-referrals-table {
        font-size: 13px;
    }
    
    .chatly-aff-referrals-table th,
    .chatly-aff-referrals-table td {
        padding: 8px;
    }
    
    .chatly-aff-form-row-inline {
        flex-direction: column;
        gap: 20px;
    }
}
