/**
 * WP Traffic Exchange - Frontend Styles (Enhanced)
 */

:root {
    --wte-primary: #3498db;
    --wte-primary-dark: #2980b9;
    --wte-success: #2ecc71;
    --wte-success-dark: #27ae60;
    --wte-warning: #f39c12;
    --wte-danger: #e74c3c;
    --wte-dark: #2c3e50;
    --wte-dark-light: #34495e;
    --wte-gray: #7f8c8d;
    --wte-gray-light: #95a5a6;
    --wte-bg-light: #f8f9fa;
    --wte-bg-white: #ffffff;
    --wte-border: #ecf0f1;
    --wte-shadow: 0 3px 15px rgba(0,0,0,0.1);
    --wte-shadow-hover: 0 5px 25px rgba(0,0,0,0.15);
    --wte-transition: all 0.3s ease;
}

.wte-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Progress Card */
.wte-progress-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--wte-shadow);
    position: relative;
    overflow: hidden;
}

.wte-progress-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.wte-progress-card h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.wte-progress-bar {
    background: rgba(255,255,255,0.3);
    border-radius: 50px;
    height: 30px;
    overflow: hidden;
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

.wte-progress-fill {
    background: linear-gradient(90deg, var(--wte-success), var(--wte-success-dark));
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.5);
    position: relative;
}

.wte-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.wte-progress-text {
    margin: 15px 0 0 0;
    font-size: 16px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* Info Card */
.wte-info-card {
    background: var(--wte-bg-white);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--wte-shadow);
    border-left: 5px solid var(--wte-primary);
}

.wte-info-card h4 {
    margin: 0 0 15px 0;
    color: var(--wte-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.wte-info-card ol {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
}

.wte-info-card li {
    margin: 10px 0;
    color: #555;
}

/* Add Site Section */
.wte-add-site-section {
    text-align: center;
    margin: 30px 0;
}

/* Buttons */
.wte-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wte-transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.wte-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wte-btn:hover::before {
    width: 300px;
    height: 300px;
}

.wte-btn .dashicons {
    position: relative;
    z-index: 1;
}

.wte-btn-primary {
    background: linear-gradient(45deg, var(--wte-primary), var(--wte-primary-dark));
    color: white;
}

.wte-btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
}

.wte-btn-primary:disabled {
    background: var(--wte-gray-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.wte-btn-success {
    background: linear-gradient(45deg, var(--wte-success), var(--wte-success-dark));
    color: white;
}

.wte-btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
}

.wte-btn-secondary {
    background: var(--wte-gray-light);
    color: white;
}

.wte-btn-secondary:hover {
    background: var(--wte-gray);
}

.wte-btn-small {
    padding: 6px 15px;
    font-size: 14px;
}

.wte-btn-view {
    background: var(--wte-primary);
    color: white;
}

.wte-btn-view:hover:not(:disabled) {
    background: var(--wte-primary-dark);
    color: white;
    text-decoration: none;
}

/* Form */
.wte-form-container {
    background: var(--wte-bg-white);
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--wte-shadow);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wte-add-form h3 {
    margin: 0 0 25px 0;
    color: var(--wte-dark);
    font-size: 22px;
}

.wte-form-group {
    margin-bottom: 20px;
}

.wte-form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--wte-dark);
    font-weight: 600;
    font-size: 14px;
}

.wte-form-group .required {
    color: var(--wte-danger);
}

.wte-form-group input[type="text"],
.wte-form-group input[type="url"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: var(--wte-transition);
}

.wte-form-group input:focus {
    outline: none;
    border-color: var(--wte-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.wte-form-group input:valid {
    border-color: var(--wte-success);
}

.wte-form-group small {
    display: block;
    margin-top: 5px;
    color: var(--wte-gray);
    font-size: 13px;
}

.wte-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

/* Sites List */
.wte-sites-list {
    background: var(--wte-bg-white);
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: var(--wte-shadow);
}

.wte-sites-list h3 {
    margin: 0 0 25px 0;
    color: var(--wte-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
}

.wte-count-badge {
    background: var(--wte-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.wte-table-responsive {
    overflow-x: auto;
}

.wte-table {
    width: 100%;
    border-collapse: collapse;
}

.wte-table thead {
    background: var(--wte-dark-light);
    color: white;
}

.wte-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wte-table td {
    padding: 15px;
    border-bottom: 1px solid var(--wte-border);
}

.wte-table tbody tr {
    transition: var(--wte-transition);
}

.wte-table tbody tr:hover {
    background: var(--wte-bg-light);
    transform: translateX(5px);
}

.wte-user-site {
    background: #e8f5e9 !important;
    border-left: 4px solid var(--wte-success);
}

.wte-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.wte-badge-success {
    background: var(--wte-success);
    color: white;
}

.wte-views-count {
    font-weight: 700;
    color: var(--wte-primary);
    font-size: 16px;
}

/* Messages */
.wte-message {
    margin: 15px 0;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.wte-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wte-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* No Sites */
.wte-no-sites {
    text-align: center;
    padding: 60px 40px;
    color: var(--wte-gray);
    font-size: 16px;
}

.wte-no-sites p:first-child {
    margin-bottom: 0;
}

/* Footer Info */
.wte-footer-info {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    text-align: center;
}

.wte-footer-info p {
    margin: 0;
    color: var(--wte-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Loading State */
.wte-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.wte-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--wte-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .wte-container {
        padding: 15px;
    }
    
    .wte-progress-card,
    .wte-info-card,
    .wte-form-container,
    .wte-sites-list {
        padding: 20px;
    }
    
    .wte-table {
        font-size: 14px;
    }
    
    .wte-table th,
    .wte-table td {
        padding: 10px 8px;
    }
    
    .wte-form-actions {
        flex-direction: column;
    }
    
    .wte-btn {
        width: 100%;
        justify-content: center;
    }
    
    .wte-count-badge {
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .wte-table thead {
        display: none;
    }
    
    .wte-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid var(--wte-border);
        border-radius: 8px;
        padding: 10px;
    }
    
    .wte-table td {
        display: block;
        text-align: right;
        padding: 8px;
        border: none;
    }
    
    .wte-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--wte-dark);
    }
}