/* Estilos específicos para la aplicación de Embajadores */

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.auth-card {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    height: 50px;
    width: auto;
    margin-bottom: 1.5rem;
    object-fit: contain;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

.auth-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group input[readonly] {
    background: var(--bg-light);
    cursor: not-allowed;
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.checkbox-label span {
    color: var(--text-dark);
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.form-group-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.forgot-password-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.settings-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.settings-section-title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.settings-danger-title {
    color: #991b1b;
}

.settings-danger-text {
    margin: -0.5rem 0 1rem 0;
    color: #7f1d1d;
    font-size: 0.95rem;
}

.settings-footer-split {
    justify-content: flex-start;
    gap: 0.75rem;
}

.amb-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.amb-detail-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.amb-detail-row {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.35rem 0;
    color: var(--text-dark);
    word-break: break-word;
}

.amb-detail-row strong {
    min-width: 140px;
    color: var(--text-secondary);
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-credit {
    background: #d1fae5;
    color: #065f46;
}

.badge-debit {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 900px) {
    .amb-detail-grid {
        grid-template-columns: 1fr;
    }
}

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

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid #dc2626;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid var(--primary-color);
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Estilos para la página de condiciones */
.condiciones-section {
    padding: 6rem 0 4rem;
    background: var(--bg-light);
    min-height: 100vh;
}

.condiciones-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.condiciones-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.condiciones-intro {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.condiciones-intro p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.condiciones-body {
    margin-top: 2rem;
}

.condiciones-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.condiciones-body h2:first-of-type {
    margin-top: 0;
}

.condiciones-body p {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.condiciones-body ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.condiciones-body li {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.condiciones-body a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.condiciones-body a:hover {
    text-decoration: underline;
}

.condiciones-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background: var(--bg-light);
}

.dashboard-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.dashboard-logo {
    height: 45px;
    width: auto;
}

.dashboard-header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.dashboard-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: var(--text-light);
    font-size: 0.95rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.dashboard-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    overflow: visible;
}

.dashboard-content {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    overflow: visible;
}

.dashboard-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    gap: 2rem;
}

.dashboard-section-header > div:first-child {
    flex: 1;
}

.dashboard-section-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.saldo-recompensas {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

.saldo-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.saldo-amount {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    border: 1px solid var(--border-color);
    position: relative;
}

.tooltip-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: normal;
    width: 280px;
    text-align: left;
    margin-bottom: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    pointer-events: none;
    font-weight: 400;
}

.tooltip-icon:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    z-index: 10001;
}

.table-container {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
}

.recommendations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.recommendations-table thead {
    background: var(--bg-light);
}

.recommendations-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.recommendations-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.recommendations-table tbody tr:hover {
    background: var(--bg-light);
}

.status-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-pendiente {
    background: #fef3c7;
    color: #92400e;
}

.status-aprobado {
    background: #d1fae5;
    color: #065f46;
}

.recompensa-aprobada {
    color: #10b981;
    font-weight: 600;
}

.recompensa-cell {
    position: relative;
}

.recompensa-pendiente {
    color: #f59e0b;
    font-weight: 600;
    cursor: help;
    display: inline-block;
    position: relative;
}

.recompensa-pendiente[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: fixed;
    padding: 0.75rem 1rem;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.5;
    z-index: 10000;
    min-width: 350px;
    max-width: 500px;
    width: max-content;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    pointer-events: none;
    font-weight: 400;
    text-align: left;
}

.recompensa-pendiente[data-tooltip]:hover::before {
    content: '';
    position: fixed;
    border: 6px solid transparent;
    border-top-color: #f59e0b;
    z-index: 10001;
    pointer-events: none;
}

.dynamic-tooltip {
    display: none;
    position: fixed;
    padding: 0.75rem 1rem;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.5;
    z-index: 10000;
    min-width: 350px;
    max-width: 500px;
    width: max-content;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    pointer-events: none;
    font-weight: 400;
    text-align: left;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.dynamic-tooltip strong {
    font-weight: 700;
    color: #78350f;
    font-size: 0.9rem;
}

.dynamic-tooltip--danger {
    background: #fee2e2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.dynamic-tooltip--danger strong {
    color: #7f1d1d;
}

.status-badge[data-tooltip] {
    cursor: help;
}

.status-denegado {
    background: #fee2e2;
    color: #991b1b;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.delete-cell {
    text-align: center;
    width: 40px;
}

.btn-delete {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 300;
    opacity: 0.6;
}

.btn-delete:hover {
    opacity: 1;
    background: #fee2e2;
    color: #dc2626;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.btn-edit {
    background: transparent;
    border: none;
    color: #2563eb;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.7;
}

.btn-edit:hover {
    opacity: 1;
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-reward {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-reward:hover {
    background: #d97706;
}

.btn-icon {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-approve {
    background: #d1fae5;
    color: #065f46;
}

.btn-approve:hover {
    background: #a7f3d0;
}

.btn-deny {
    background: #fee2e2;
    color: #991b1b;
}

.btn-deny:hover {
    background: #fecaca;
}

.loading-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

/* Modal Styles */
.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(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-form {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

.required {
    color: #dc2626;
}

.dashboard-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.modal-large {
    max-width: 900px;
}

.sql-editor-container {
    padding: 2rem;
}

.sql-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 200px;
}

.sql-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.sql-results {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.sql-results h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.sql-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.sql-results-table thead {
    background: var(--bg-light);
}

.sql-results-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

.sql-results-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.sql-results-table tbody tr:hover {
    background: var(--bg-light);
}

/* Responsive */
@media (max-width: 768px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .condiciones-content {
        padding: 2rem 1.5rem;
    }
    
    .condiciones-content h1 {
        font-size: 2rem;
    }
    
    .condiciones-body h2 {
        font-size: 1.25rem;
    }
    
    .condiciones-footer {
        flex-direction: column;
    }
    
    .condiciones-footer .btn {
        width: 100%;
    }
    
    .dashboard-header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .dashboard-header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .dashboard-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .dashboard-section-header .btn {
        width: 100%;
    }
    
    .recommendations-table {
        font-size: 0.85rem;
    }
    
    .recommendations-table th,
    .recommendations-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-form {
        padding: 1.5rem;
    }
}
