/* Components CSS for TruthLens */

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
    padding: 0 2rem;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.navbar-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-link:hover {
    color: var(--text-primary);
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-size: 1.25rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Notifications */
.notification {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    min-width: 320px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.notification.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.notification.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.notification.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-backdrop.hidden {
    display: none;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Cancel Modal Specific Styles */
#cancel-modal .modal {
    max-width: 42rem;
}

#cancel-modal ul {
    list-style: none;
}

#cancel-modal ul li:before {
    content: '✗';
    color: #ef4444;
    margin-right: 0.5rem;
}

/* Downgrade Option Cards */
.downgrade-option {
    padding: 1.5rem;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.3s ease;
}

.downgrade-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.downgrade-option.selected {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
}

/* Modal Animations */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Modal Scrollbar */
.modal::-webkit-scrollbar {
    width: 8px;
}

.modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.modal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Progress Bars */
.progress {
    width: 100%;
    height: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* Error States */
.error-red {
    background-color: rgba(239, 68, 68, 0.2);
    border-bottom: 2px solid #ef4444;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-red:hover {
    background-color: rgba(239, 68, 68, 0.3);
}

.error-yellow {
    background-color: rgba(245, 158, 11, 0.2);
    border-bottom: 2px solid #f59e0b;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-yellow:hover {
    background-color: rgba(245, 158, 11, 0.3);
}

.error-orange {
    background-color: rgba(251, 146, 60, 0.2);
    border-bottom: 2px dotted #fb923c;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-orange:hover {
    background-color: rgba(251, 146, 60, 0.3);
}

/* Pricing Cards */
.pricing-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.pricing-card.featured {
    border: 2px solid var(--accent-primary);
    transform: scale(1.05);
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-8px);
}

.pricing-badge {
    position: absolute;
    top: -1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Stats Cards */
.stats-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stats-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

/* Accordion */
.accordion-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.accordion-header {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-content {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-secondary);
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-item.open .accordion-icon {
    transform: rotate(180deg);
}

/* ========================================
   SIDEBAR COMPONENT STYLES (PURPLE THEME)
   Centralized from: dashboard, miagenda, account, patients, etc.
   ======================================== */

/* Gradient background orbs */
.gradient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.04;
    animation: float-slow 25s infinite ease-in-out;
    pointer-events: none;
}

@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -20px) scale(1.05); }
}

/* Sidebar - Deep navy blue */
.sidebar-glass {
    background: #0a0044;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

/* Nav link - CLEAN PROFESSIONAL */
.nav-link {
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    display: block;
    padding: 10px 12px;
    margin: 2px 0;
    border-radius: 16px;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: #ffffff;
    font-weight: 600;
    background: #3d75ef;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0px;
    height: 0px;
    background: transparent;
    border-radius: 0px;
}

/* Nav link - GESTION (orange/amber theme matching "Notas SOAP" button) */
.nav-link.nav-link-gestion.active {
    background: #3d75ef !important;
}

.nav-link.nav-link-gestion.active::before {
    background: transparent !important;
}

/* Status dot indicator */
.status-dot {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* User profile link */
.user-profile-link {
    position: relative;
    text-decoration: none;
    transition: all 0.2s ease;
}

.user-profile-link.active {
    background: rgba(61, 117, 239, 0.15) !important;
    border-radius: 12px !important;
}

.user-profile-link.active::before {
    display: none;
}

/* Dark mode sidebar styles */
[data-theme="dark"] .sidebar-glass {
    background: #1a1d2e;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .nav-link {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .nav-link.active {
    color: #ffffff;
    background: rgba(96, 196, 166, 0.12);
}

[data-theme="dark"] .nav-link.nav-link-gestion.active {
    background: rgba(245, 158, 11, 0.12) !important;
}

[data-theme="dark"] .status-dot {
    background-color: #60c4a6;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar-glass {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 40;
    }

    .sidebar-glass.open {
        transform: translateX(0);
    }
}