/**
 * SongLab Affiliates Dashboard Styles
 */

.songlab-affiliates-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.affiliate-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.dashboard-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-item {
    padding: 10px 20px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    background: #007cba;
    color: white;
    text-decoration: none;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 14px;
    color: #666;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.quick-action {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
}

.quick-action:hover {
    border-color: #007cba;
    background: #f8f9fa;
    text-decoration: none;
    color: #007cba;
}

.quick-action .icon {
    font-size: 24px;
    margin-right: 10px;
}

/* Referral Links */
.referral-links-grid,
.referral-links-list {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.referral-links-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.referral-link-item,
.referral-link-card {
    background: white;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.link-container,
.link-input-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.referral-link-input,
.link-input-group input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

.copy-link-btn,
.copy-btn {
    padding: 8px 16px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.copy-link-btn:hover,
.copy-btn:hover {
    background: #005a87;
}

/* Promo Codes */
.promo-codes-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.promo-codes-table th,
.promo-codes-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.promo-codes-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-paid {
    background: #d1ecf1;
    color: #0c5460;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.button:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.button-primary {
    background: #007cba;
}

.button-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* Tables */
.commissions-table,
.withdrawals-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.commissions-table th,
.commissions-table td,
.withdrawals-table th,
.withdrawals-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.commissions-table th,
.withdrawals-table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-navigation {
        justify-content: center;
    }

    .nav-item {
        text-align: center;
        flex: 1;
    }

    .link-container,
    .link-input-group {
        flex-direction: column;
    }
}

/* Notifications */
.songlab-affiliates-notice {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.notice-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notice-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Pages */
.songlab-affiliates-pending,
.songlab-affiliates-rejected,
.songlab-affiliates-inactive {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.status-content {
    text-align: center;
    padding: 40px 20px;
}

.status-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.status-content h4 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.status-content > p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.application-details,
.rejection-reason,
.rejection-info,
.account-details,
.inactive-reason {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
}

.application-details h5,
.rejection-reason h5,
.rejection-info h5,
.account-details h5,
.inactive-reason h5 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.application-details ul,
.rejection-info ul,
.account-details ul {
    list-style: none;
    padding: 0;
}

.application-details li,
.account-details li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.application-details li:last-child,
.account-details li:last-child {
    border-bottom: none;
}

.rejection-info ul {
    list-style: disc;
    padding-left: 20px;
}

.rejection-info li {
    padding: 4px 0;
    color: #666;
}

.reapply-section,
.reactivation-info,
.pending-actions,
.contact-support {
    background: white;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
}

.reapply-section h5,
.reactivation-info h5 {
    color: #007cba;
    margin-bottom: 10px;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

/* Error and Success Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Dashboard Referral Info Section */
.dashboard-referral-info {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.dashboard-referral-info h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.referral-section,
.promo-section {
    margin-bottom: 30px;
}

.referral-section:last-child,
.promo-section:last-child {
    margin-bottom: 0;
}

/* Referral Code Display */
.referral-code-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.code-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.current-code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #007cba;
    background: white;
    padding: 10px 15px;
    border: 2px solid #007cba;
    border-radius: 6px;
    flex: 1;
    max-width: 200px;
}

.edit-code-btn,
.save-code-btn,
.cancel-edit-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.edit-code-btn {
    background: #6c757d;
    color: white;
}

.edit-code-btn:hover {
    background: #5a6268;
}

.save-code-btn {
    background: #28a745;
    color: white;
}

.save-code-btn:hover {
    background: #218838;
}

.cancel-edit-btn {
    background: #dc3545;
    color: white;
}

.cancel-edit-btn:hover {
    background: #c82333;
}

.edit-form {
    display: none;
    margin-top: 15px;
}

.edit-form.active {
    display: block;
}

.edit-input {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    margin-bottom: 10px;
}

.edit-input:focus {
    outline: none;
    border-color: #007cba;
}

.edit-buttons {
    display: flex;
    gap: 10px;
}

/* Referral Links List */
.referral-links {
    margin-top: 20px;
}

.referral-links h4 {
    margin-bottom: 15px;
    color: #555;
    font-size: 16px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.link-title {
    font-weight: 500;
    min-width: 100px;
    color: #333;
}

.link-url {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    color: #666;
    word-break: break-all;
}

.copy-link-btn {
    padding: 6px 12px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.copy-link-btn:hover {
    background: #005a87;
}

.copy-link-btn.copied {
    background: #28a745;
}

/* Promo Codes Section */
.promo-codes-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.current-promos {
    margin-bottom: 20px;
}

.promo-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.promo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.promo-code {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #007cba;
}

.promo-discount {
    color: #28a745;
    font-weight: 500;
}

.copy-promo-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 2px;
    font-size: 12px;
}

.copy-promo-btn:hover {
    color: #007cba;
}

/* Quick Create Promo */
.quick-create-promo {
    background: white;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.quick-create-promo h5 {
    margin-bottom: 15px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.promo-create-form {
    display: flex;
    gap: 10px;
    align-items: end;
}

.form-group-inline {
    flex: 1;
    margin-bottom: 0;
}

.form-group-inline label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.form-group-inline input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.create-promo-btn {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.create-promo-btn:hover {
    background: #218838;
}

.create-promo-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Loading states for referral section */
.referral-code-display.loading,
.promo-codes-section.loading {
    opacity: 0.6;
    pointer-events: none;
}

.code-container.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* Mobile responsiveness for referral sections */
@media (max-width: 768px) {
    .code-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .current-code {
        max-width: none;
        text-align: center;
    }

    .edit-buttons {
        justify-content: center;
    }

    .link-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .link-title {
        min-width: auto;
        text-align: center;
    }

    .promo-create-form {
        flex-direction: column;
        gap: 15px;
    }

    .promo-list {
        justify-content: center;
    }
}

/* Mobile responsiveness for status pages */
@media (max-width: 768px) {
    .status-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .status-content {
        padding: 20px 10px;
    }

    .status-icon {
        font-size: 48px;
    }

    .status-content h4 {
        font-size: 20px;
    }
}

/* Registration Form Styles */
.songlab-affiliates-register-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.songlab-affiliates-register-form h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
    text-align: center;
}

.songlab-affiliates-register-form > p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Social Media Section */
.social-media-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.social-media-section h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 18px;
}

.form-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group.half-width {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.form-group input[type="number"] {
    -webkit-appearance: textfield;
}

.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Checkbox styling */
.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
    cursor: pointer;
}

/* Button styling */
.affiliate-registration-form .button {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
}

/* Mobile responsiveness for registration form */
@media (max-width: 768px) {
    .songlab-affiliates-register-form {
        margin: 10px;
        padding: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .social-media-section {
        padding: 15px;
        margin: 20px 0;
    }

    .songlab-affiliates-register-form h3 {
        font-size: 20px;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="number"],
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Error and success message styling for forms */
.affiliate-registration-form .error-message,
.affiliate-registration-form .success-message {
    margin-bottom: 20px;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.affiliate-registration-form .error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.affiliate-registration-form .success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Social media input placeholders */
.form-group input::placeholder {
    color: #999;
    font-style: italic;
}

/* Hover effects for inputs */
.form-group input[type="text"]:hover,
.form-group input[type="email"]:hover,
.form-group input[type="number"]:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #bbb;
}

/* Focus states for better accessibility */
.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* Additional spacing for form sections */
.affiliate-registration-form h4 {
    margin-top: 30px;
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}