/* File: assets/css/frontend.css */

/* Elementor Compatibility - Remove fixed dimensions and use flexible sizing */
.vizonix-card-selector {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin: 0; /* Remove fixed margin for Elementor */
    overflow: hidden;
    direction: rtl;
    font-family: 'IRANSans', Arial, sans-serif;
    width: 100%; /* Full width of container */
    height: auto; /* Auto height */
}

.card-selector-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5em 2em; /* Use em instead of px for scalability */
    text-align: center;
}

.card-selector-title {
    font-size: 1.5em; /* Relative font size */
    font-weight: bold;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.card-management {
    padding: 2em; /* Use em for scalability */
}

.user-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5em; /* Use em */
    margin-bottom: 1.5em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Rest of the existing styles with relative units... */

/* Elementor Widget Specific Styles */
.elementor-widget-container .vizonix-card-selector {
    margin: 0;
    width: 100%;
}

/* Remove conflicting responsive styles when inside Elementor */
.elementor-widget-container .vizonix-card-selector,
.elementor-widget-container .vizonix-card-selector * {
    box-sizing: border-box;
}

/* Override media queries for Elementor */
@media (max-width: 768px) {
    .elementor-widget-container .vizonix-card-selector {
        margin: 0;
        border-radius: 8px;
    }
    
    .elementor-widget-container .card-selector-header {
        padding: 1.2em;
    }
}
/* File: assets/css/frontend.css */

/* Card Selector Styles */
.vizonix-card-selector {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin: 20px 0;
    overflow: hidden;
    direction: rtl;
    font-family: 'IRANSans', Arial, sans-serif;
}

.card-selector-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.card-selector-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.card-management {
    padding: 30px;
}

.user-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card-details {
    margin-bottom: 20px;
}

.card-name {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.card-url {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 8px;
    display: inline-block;
    transition: color 0.3s ease;
}

.card-url:hover {
    color: #764ba2;
    text-decoration: underline;
}

.card-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.style-selector {
    margin: 20px 0;
}

.style-selector h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
}

.style-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.style-option {
    position: relative;
    cursor: pointer;
}

.style-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.style-option-label {
    display: block;
    padding: 15px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.style-option-label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.style-option input[type="radio"]:checked + .style-option-label {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
    transform: scale(1.02);
}

.style-option-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.style-option-description {
    font-size: 12px;
    opacity: 0.8;
}

.preview-section {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.preview-title {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: bold;
}

.preview-content {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.preview-iframe {
    width: 100%;
    height: 280px;
    border: none;
    border-radius: 6px;
}

.save-style-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.save-style-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.save-style-btn:active {
    transform: translateY(0);
}

.save-style-btn.loading {
    position: relative;
    color: transparent;
}

.save-style-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.no-cards-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.no-cards-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-cards-text {
    font-size: 16px;
    margin-bottom: 10px;
}

.no-cards-subtext {
    font-size: 14px;
    color: #adb5bd;
}

/* Success/Error Messages */
.vizonix-message {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 8px;
    font-weight: 500;
}

.vizonix-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.vizonix-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.vizonix-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vizonix-card-selector {
        margin: 10px;
        border-radius: 8px;
    }
    
    .card-selector-header {
        padding: 20px;
    }
    
    .card-selector-title {
        font-size: 20px;
    }
    
    .card-management {
        padding: 20px;
    }
    
    .user-card {
        padding: 20px;
    }
    
    .style-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .style-option-label {
        padding: 12px;
    }
    
    .preview-iframe {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .card-selector-header {
        padding: 15px;
    }
    
    .card-management {
        padding: 15px;
    }
    
    .user-card {
        padding: 15px;
    }
    
    .card-name {
        font-size: 18px;
    }
    
    .save-style-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
}

/* Animation */
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-card {
    animation: fadeIn 0.5s ease-out;
}

/* Login Required Message */
.login-required {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 20px 0;
}

.login-required h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.login-required p {
    color: #6c757d;
    margin-bottom: 20px;
}

.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.login-btn:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
