/* ===================================
   SECURITY BADGE STYLES
   =================================== */

/* ========== BADGE FLOTANTE ========== */

.security-badge {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    
    background: rgba(40, 39, 40, 0.95);
    color: var(--text-dark);
    padding: 1rem 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    
    cursor: pointer;
    z-index: 998;
    
    border: 1px solid rgba(110, 9, 147, 0.3);
    box-shadow: 0 4px 15px rgba(110, 9, 147, 0.2);
    
    transition: all var(--transition-fast);
}

.security-badge:hover {
    border-color: var(--purple);
    box-shadow: 0 0 20px rgba(110, 9, 147, 0.4);
    transform: translateY(-50%) scale(1.05);
}

/* Light mode */
body.light-mode .security-badge {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-light);
    border-color: rgba(110, 9, 147, 0.2);
}

body.light-mode .security-badge:hover {
    border-color: var(--purple);
}

/* ========== POPUP AUTOMÁTICO ========== */

.security-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 350px;
    
    background: rgba(40, 39, 40, 0.98);
    color: var(--text-dark);
    padding: 1.5rem;
    border-radius: 12px;
    
    border: 1px solid rgba(110, 9, 147, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    
    z-index: 999;
    
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    
    transition: all var(--transition-smooth);
}

.security-popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.security-popup p {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.popup-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.popup-cta {
    background: var(--purple);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all var(--transition-fast);
}

.popup-cta:hover {
    background: var(--purple-light);
    box-shadow: 0 0 15px rgba(110, 9, 147, 0.3);
}

/* Light mode popup */
body.light-mode .security-popup {
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-light);
}

body.light-mode .popup-close {
    color: var(--text-light);
}

/* ========== MODAL ========== */

.security-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.security-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.3s ease;
}

.modal-container {
    position: relative;
    background: #282728;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    padding: 2.5rem;
    
    border: 1px solid rgba(110, 9, 147, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    
    animation: slideUp 0.4s ease;
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.modal-title {
    color: var(--purple);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ========== TABS ========== */

.modal-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(110, 9, 147, 0.2);
}

.tab-button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    flex: 1;
}

.tab-button:hover {
    color: rgba(255, 255, 255, 0.9);
}

.tab-button.active {
    color: white;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--purple);
    box-shadow: 0 0 8px rgba(110, 9, 147, 0.5);
}

/* ========== TAB CONTENT ========== */

.modal-content {
    min-height: 150px;
}

.tab-panel {
    display: none;
    animation: fadeSlideIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

.tab-panel p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

/* ========== MEDIUM LINK ========== */

.medium-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    transition: all var(--transition-fast);
    position: relative;
}

.medium-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--green);
    transition: width var(--transition-fast);
}

.medium-link:hover {
    color: var(--green-light);
}

.medium-link:hover::after {
    width: 100%;
}

/* ========== LIGHT MODE MODAL ========== */

body.light-mode .modal-container {
    background: white;
    color: var(--text-light);
}

body.light-mode .modal-title {
    color: var(--purple);
}

body.light-mode .modal-close {
    color: var(--text-light);
}

body.light-mode .tab-button {
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode .tab-button:hover {
    color: rgba(0, 0, 0, 0.9);
}

body.light-mode .tab-button.active {
    color: var(--text-light);
}

body.light-mode .tab-panel p {
    color: rgba(0, 0, 0, 0.85);
}

/* ========== ANIMACIONES ========== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .security-badge {
        right: 10px;
        font-size: 0.75rem;
        padding: 0.8rem 0.4rem;
    }
    
    .security-popup {
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-width: none;
    }
    
    .modal-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
    
    .tab-button {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    .tab-panel p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .security-badge {
        writing-mode: horizontal-tb;
        right: 50%;
        top: auto;
        bottom: 10px;
        transform: translateX(50%);
        padding: 0.5rem 1rem;
    }
    
    .security-badge:hover {
        transform: translateX(50%) scale(1.05);
    }
}