/* DRTV Affiliate Plugin - Frontend Styles */

/* General Styles */
.drtv-affiliate-register,
.drtv-affiliate-login,
.drtv-affiliate-dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Form Styles */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #dc3232;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #0073aa;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Message Styles */
.success,
.error {
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: 600;
}

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

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

/* Dashboard Styles */
.drtv-affiliate-dashboard {
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.dashboard-header h1 {
    color: #0073aa;
    margin-bottom: 10px;
}

.stats-overview {
    margin-bottom: 40px;
}

.stats-overview h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.stat-content h3 {
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2.5em;
    font-weight: 700;
    color: #0073aa;
    margin: 0;
}

/* Date Range Selector */
.date-range-selector {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.date-range-selector h3 {
    margin-bottom: 20px;
    color: #333;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.date-inputs label {
    font-weight: 600;
    color: #555;
}

.date-inputs input[type="date"] {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.custom-stats-display {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Affiliate Links */
.affiliate-links {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.affiliate-links h3 {
    margin-bottom: 15px;
    color: #333;
}

.link-item {
    margin-bottom: 20px;
}

.link-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.link-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.link-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #f8f9fa;
    cursor: text;
}

.copy-btn {
    white-space: nowrap;
}

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

/* Marketing Tools */
.marketing-tools {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.marketing-tools h3 {
    margin-bottom: 20px;
    color: #333;
}

.creatives-section {
    margin-bottom: 25px;
}

.creatives-section h4 {
    color: #555;
    margin-bottom: 10px;
}

.tracking-info h4 {
    color: #555;
    margin-bottom: 15px;
}

.tracking-info p {
    margin-bottom: 8px;
    color: #666;
}

/* Account Information */
.account-info {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.account-info h3 {
    margin-bottom: 20px;
    color: #333;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.info-item label {
    font-weight: 600;
    color: #555;
}

.info-item span {
    color: #333;
}

/* Dashboard Actions */
.dashboard-actions {
    text-align: center;
    padding: 20px 0;
}

.dashboard-actions .btn {
    margin: 0 10px;
}

/* Modal Styles */
.drtv-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.drtv-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.drtv-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.drtv-modal-close:hover {
    color: #333;
}

.creatives-content {
    margin-top: 20px;
}

.creative-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: #f8f9fa;
}

.creative-item h3 {
    color: #0073aa;
    margin-bottom: 15px;
}

.creative-item img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 15px 0;
}

.creative-content {
    margin: 15px 0;
    line-height: 1.6;
    color: #555;
}

.creative-links {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.creative-links a {
    color: #0073aa;
    text-decoration: none;
    word-break: break-all;
}

.creative-links a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .date-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .link-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .drtv-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .dashboard-actions .btn {
        display: block;
        margin: 10px auto;
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .drtv-affiliate-register,
    .drtv-affiliate-login,
    .drtv-affiliate-dashboard {
        padding: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 2em;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .stat-card {
        border: 2px solid #333;
    }
}
