/* ============================================
   You-Space - Variables y Base
   ============================================ */
:root {
    --bg-primary: #0A0A2A;
    --bg-secondary: #0D0D35;
    --accent-cyan: #00C2FF;
    --accent-cyan-dim: rgba(0, 194, 255, 0.6);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(15, 15, 45, 0.6);
    --glass-border: rgba(0, 194, 255, 0.3);
    --glow-color: rgba(0, 194, 255, 0.4);
}

body[data-theme='light'] {
    --bg-primary: #eef4ff;
    --bg-secondary: #dce9ff;
    --accent-cyan: #0b74d8;
    --accent-cyan-dim: rgba(11, 116, 216, 0.5);
    --text-primary: #0b1730;
    --text-secondary: rgba(11, 23, 48, 0.82);
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(11, 116, 216, 0.25);
    --glow-color: rgba(11, 116, 216, 0.24);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Fondo con patrón de circuitos/red */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 194, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 194, 255, 0.02) 0%, transparent 50%),
        linear-gradient(180deg, #0A0A2A 0%, #05051A 100%);
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(0, 194, 255, 0.08) 0%, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(0, 194, 255, 0.06) 0%, transparent 1px),
        linear-gradient(90deg, transparent 49%, rgba(0, 194, 255, 0.03) 50%, transparent 51%),
        linear-gradient(0deg, transparent 49%, rgba(0, 194, 255, 0.03) 50%, transparent 51%);
    background-size: 60px 60px, 80px 80px, 100px 100px, 100px 100px;
    opacity: 0.6;
    z-index: -1;
    pointer-events: none;
}

/* ============================================
   Header / Barra de Navegación
   ============================================ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 194, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.35rem;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-cyan);
    flex-shrink: 0;
}

.logo-you {
    color: var(--accent-cyan);
}

.logo-space {
    color: var(--text-primary);
}

.logo-text {
    display: flex;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.5rem);
}

@media (max-width: 900px) {
    .nav-links {
        display: none;
    }
    
    .header {
        padding: 1rem 1.5rem;
    }
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent-cyan);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-access-btn {
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 194, 255, 0.12);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    transition: all 0.2s;
}

.user-access-btn:hover {
    background: rgba(0, 194, 255, 0.2);
    box-shadow: 0 0 15px var(--glow-color);
}

.search-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--accent-cyan);
    background: transparent;
    color: var(--accent-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

.search-btn:hover {
    background: rgba(0, 194, 255, 0.15);
    box-shadow: 0 0 20px var(--glow-color);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.theme-icon {
    font-size: 1.1rem;
}

.toggle-switch {
    width: 48px;
    height: 26px;
    background: rgba(0, 194, 255, 0.2);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--glass-border);
}

.toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-knob.active {
    transform: translateX(22px);
    background: var(--accent-cyan);
    box-shadow: 0 0 12px var(--accent-cyan);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    margin-bottom: 4rem;
    max-width: 600px;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero-title .hero-accent {
    color: var(--accent-cyan);
    text-shadow: 0 0 30px var(--glow-color);
}

.hero-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.9) 0%, rgba(0, 150, 200, 0.9) 100%);
    border: 1px solid var(--accent-cyan);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 20px var(--glow-color);
    font-family: inherit;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--glow-color), 0 4px 15px rgba(0, 194, 255, 0.3);
}

/* ============================================
   Cards Grid - Glassmorphism
   ============================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    min-height: 160px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.4) 0%, transparent 50%, rgba(0, 194, 255, 0.1) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 30px var(--glow-color), 0 10px 40px rgba(0, 0, 0, 0.3);
}

.card-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}

.hidden {
    display: none !important;
}

.tool-no-video {
    color: rgba(255, 255, 255, 0.4);
}

/* Panel de herramientas - Estilo tecnológico You-Space */
.tools-panel {
    display: none;
    width: 100%;
    margin-top: 2rem;
}

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

.community-panel {
    display: none;
    width: 100%;
    margin-top: 2rem;
}

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

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

.tools-panel-title {
    color: var(--accent-cyan);
    font-size: 1.5rem;
    font-weight: 600;
}

.tools-panel-category {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tools-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tools-back-btn {
    padding: 0.6rem 1.2rem;
    background: rgba(0, 194, 255, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.tools-back-btn:hover {
    background: rgba(0, 194, 255, 0.3);
    box-shadow: 0 0 15px var(--glow-color);
}

.tools-table-wrapper {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 194, 255, 0.1);
}

.tools-table {
    width: 100%;
    border-collapse: collapse;
}

.tools-table th,
.tools-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 194, 255, 0.15);
}

.tools-table th {
    background: rgba(0, 194, 255, 0.1);
    color: var(--accent-cyan);
    font-weight: 600;
    font-size: 0.9rem;
}

.tools-table td {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tools-table tbody tr:hover {
    background: rgba(0, 194, 255, 0.05);
}

.tools-table tbody tr:last-child td {
    border-bottom: none;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}

.tool-btn-visitar {
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.8), rgba(0, 150, 200, 0.8));
    color: #0A0A2A;
}

.tool-btn-visitar:hover {
    box-shadow: 0 0 15px var(--glow-color);
}

.tool-btn-video {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.tool-btn-video:hover {
    background: rgba(0, 194, 255, 0.2);
}

.tool-btn-edit {
    background: rgba(0, 194, 255, 0.2);
    color: var(--accent-cyan);
    padding: 0.4rem 0.8rem;
}

.tool-btn-delete {
    background: rgba(232, 17, 35, 0.3);
    color: #ff6b6b;
    padding: 0.4rem 0.8rem;
}

.tool-btn-add {
    background: rgba(0, 194, 255, 0.2);
    color: var(--accent-cyan);
    border: 1px solid var(--glass-border);
}

.tool-btn-edit:hover,
.tool-btn-delete:hover {
    opacity: 0.9;
}

.tool-actions {
    display: flex;
    gap: 8px;
}

.vip-card {
    border-color: rgba(255, 215, 0, 0.45);
}

.vip-card:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.25);
}

.forum-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
}

.forum-form {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.forum-form textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(5, 5, 26, 0.68);
    color: var(--text-primary);
    padding: 0.7rem;
    font-family: inherit;
}

.forum-form-actions {
    display: flex;
    justify-content: flex-end;
}

.forum-list {
    display: grid;
    gap: 0.6rem;
}

.forum-comment {
    border: 1px solid rgba(0, 194, 255, 0.2);
    border-radius: 10px;
    padding: 0.7rem;
    background: rgba(0, 194, 255, 0.05);
}

.forum-comment-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.forum-comment-content {
    font-size: 0.9rem;
    color: var(--text-primary);
}

@media (max-width: 900px) {
    .tools-table-wrapper {
        overflow-x: auto;
    }
    
    .tools-table {
        min-width: 800px;
    }
}

/* Modal Próximamente */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-title {
    color: var(--accent-cyan);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.modal-text {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-close {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.9), rgba(0, 150, 200, 0.9));
    border: 1px solid var(--accent-cyan);
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 0.9;
}

.tool-form-modal {
    max-width: 560px;
    text-align: left;
}

.tool-form {
    display: grid;
    gap: 0.9rem;
}

.tool-form-label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.tool-form input,
.tool-form textarea,
.tool-form select {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(5, 5, 26, 0.7);
    color: var(--text-primary);
    padding: 0.65rem 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
}

.tool-form input:focus,
.tool-form textarea:focus,
.tool-form select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(0, 194, 255, 0.18);
}

.tool-form-actions {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.auth-error {
    color: #ff7b7b;
    font-size: 0.85rem;
    margin: -0.25rem 0 0;
}

.subscription-plans {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.subscription-billing-toggle {
    display: inline-flex;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    overflow: hidden;
    margin: 0 0 0.9rem;
    background: rgba(5, 5, 26, 0.55);
}

.subscription-billing-btn {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
}

.subscription-billing-btn.active {
    background: rgba(0, 194, 255, 0.22);
    color: var(--text-primary);
}

.subscription-dynamic-saving {
    margin: 0 0 0.9rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(0, 194, 255, 0.08);
    display: grid;
    gap: 0.1rem;
    transition: all 0.25s ease;
}

.subscription-dynamic-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

#subscription-saving-value {
    color: var(--accent-cyan);
    font-size: 1.05rem;
}

#subscription-saving-note {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.subscription-dynamic-saving.yearly {
    border-color: rgba(59, 224, 143, 0.5);
    background: rgba(59, 224, 143, 0.12);
    transform: translateY(-1px);
}

.subscription-plan {
    border: 1px solid var(--glass-border);
    background: rgba(5, 5, 26, 0.6);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: left;
    display: grid;
    gap: 0.2rem;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    transition: all 0.25s ease;
}

.subscription-plan.active {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(0, 194, 255, 0.2), 0 0 24px rgba(0, 194, 255, 0.18);
    animation: subscriptionPlanGlow 1.8s ease-in-out infinite;
}

.subscription-plan-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.subscription-plan-price {
    font-size: 1.1rem;
}

.subscription-plan-badge {
    position: absolute;
    top: -10px;
    right: 8px;
    background: linear-gradient(135deg, #00c2ff, #3be08f);
    color: #04111f;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
}

.subscription-plan-badge-sold {
    top: 16px;
    right: 8px;
    background: linear-gradient(135deg, #ffd24d, #ff9f1a);
    color: #2c1600;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.subscription-plan.active .subscription-plan-badge-sold {
    opacity: 1;
    transform: scale(1);
}

.subscription-plan-saving {
    color: #3be08f;
}

.subscription-methods {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin-bottom: 0.5rem;
}

@keyframes subscriptionPlanGlow {
    0% {
        box-shadow: 0 0 0 2px rgba(0, 194, 255, 0.2), 0 0 14px rgba(0, 194, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 0 2px rgba(0, 194, 255, 0.28), 0 0 28px rgba(0, 194, 255, 0.24);
    }
    100% {
        box-shadow: 0 0 0 2px rgba(0, 194, 255, 0.2), 0 0 14px rgba(0, 194, 255, 0.1);
    }
}
