/**
 * TVPlus Installer - Estilos CSS
 * Version: 5.0.0
 */

:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #f093fb;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --dark: #2d3436;
    --light: #f8f9fa;
    --white: #ffffff;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --border-radius: 8px;
    --box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.installer-header {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 40px;
}

.logo h1 {
    color: var(--white);
    font-size: 24px;
    font-weight: 600;
}

.version {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--white);
}

#language-selector {
    background: rgba(255,255,255,0.2);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
}

/* Progress Bar */
.progress-section {
    background: rgba(255,255,255,0.95);
    padding: 30px 0;
}

.progress-bar-wrapper {
    position: relative;
}

.progress-bar {
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.5s ease;
    border-radius: 4px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.progress-step {
    text-align: center;
    position: relative;
    flex: 1;
    opacity: 0.5;
    transition: var(--transition);
}

.progress-step.active {
    opacity: 1;
}

.progress-step.current .step-number {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.2);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-light);
    color: var(--gray);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
    transition: var(--transition);
}

.progress-step.active .step-number {
    background: var(--success-color);
    color: var(--white);
}

.step-label {
    display: block;
    font-size: 14px;
    color: var(--gray);
}

.progress-step.active .step-label {
    color: var(--dark);
    font-weight: 500;
}

/* Main Content */
.installer-content {
    background: var(--white);
    min-height: 500px;
    padding: 40px 0;
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.step-header {
    text-align: center;
    margin-bottom: 40px;
}

.step-header h2 {
    font-size: 32px;
    color: var(--dark);
    margin-bottom: 10px;
}

.step-description {
    color: var(--gray);
    font-size: 18px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    border-left: 4px solid var(--success-color);
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-left: 4px solid var(--danger-color);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-left: 4px solid var(--info-color);
    color: #0c5460;
}

.alert strong {
    display: block;
    margin-bottom: 5px;
}

.alert ul {
    margin: 10px 0 0 20px;
}

/* Forms */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-text {
    display: block;
    margin-top: 5px;
    color: var(--gray);
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Requirements Check */
.requirements-grid {
    display: grid;
    gap: 15px;
}

.requirement-item {
    background: var(--light);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.requirement-item:hover {
    transform: translateX(5px);
}

.requirement-item.success {
    border-left: 4px solid var(--success-color);
}

.requirement-item.error {
    border-left: 4px solid var(--danger-color);
    background: #fff5f5;
}

.requirement-item.warning {
    border-left: 4px solid var(--warning-color);
    background: #fffbf0;
}

.requirement-name {
    font-weight: 500;
}

.requirement-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--white);
}

.status-icon.success {
    background: var(--success-color);
}

.status-icon.error {
    background: var(--danger-color);
}

.status-icon.warning {
    background: var(--warning-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--gray);
}

.btn-success {
    background: var(--success-color);
}

.btn-danger {
    background: var(--danger-color);
}

.btn-block {
    display: block;
    width: 100%;
}

.buttons-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--gray-light);
}

/* Installation Progress */
.installation-tasks {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 30px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-light);
}

.task-item:last-child {
    border-bottom: none;
}

.task-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    transition: var(--transition);
}

.task-item.pending .task-icon {
    background: var(--gray-light);
    color: var(--gray);
}

.task-item.processing .task-icon {
    background: var(--primary-color);
    color: var(--white);
    animation: pulse 1.5s infinite;
}

.task-item.completed .task-icon {
    background: var(--success-color);
    color: var(--white);
}

.task-item.error .task-icon {
    background: var(--danger-color);
    color: var(--white);
}

.task-content {
    flex: 1;
}

.task-name {
    font-weight: 500;
    color: var(--dark);
}

.task-status {
    font-size: 14px;
    color: var(--gray);
    margin-top: 5px;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Success Page */
.success-container {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--success-color), #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 60px;
    color: var(--white);
}

.success-title {
    font-size: 36px;
    color: var(--dark);
    margin-bottom: 20px;
}

.success-message {
    font-size: 18px;
    color: var(--gray);
    margin-bottom: 40px;
}

.access-info {
    background: var(--light);
    border-radius: var(--border-radius);
    padding: 30px;
    margin: 30px 0;
    text-align: left;
}

.access-info h3 {
    margin-bottom: 20px;
    color: var(--dark);
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-light);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: var(--gray);
}

.info-value {
    color: var(--dark);
    word-break: break-all;
}

.info-value a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

/* Footer */
.installer-footer {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--white);
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    margin: 0 10px;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 0.8;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    text-align: center;
}

.spinner-border {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner p {
    color: var(--white);
    margin-top: 20px;
    font-size: 18px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 9998;
}

.modal-overlay.active {
    display: block;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    display: none;
    z-index: 9999;
}

.modal-container.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .progress-steps {
        display: none;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .buttons-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
    }
}