/* ============================================
   NoLeakOS Blog — hereda la paleta de styles.css
   ============================================ */
:root {
  --black: #000000;
  --black-light: #0d0d0d;
  --white: #ffffff;
  --gray-light: #eaeaea;
  --gray-medium: #999999;
  --gray-dark: #333333;
  --accent-blue: #4a90e2;
  --accent-purple: #8b7ec8;
  --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--black);
  color: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}
a { text-decoration: none; color: var(--accent-blue); transition: var(--transition); }
a:hover { color: var(--white); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ---------- Header (clon del de la web) ---------- */
#header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background-color: rgba(0, 0, 0, 0.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 1rem 2rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.logo-img { height: 34px; width: auto; max-width: 180px; object-fit: contain; }
.nav-menu { display: flex; gap: 1.8rem; align-items: center; }
.nav-menu a { color: var(--white); font-size: 0.95rem; font-weight: 500; position: relative; }
.nav-menu a::after {
  content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px;
  background-color: var(--white); transition: width 0.3s ease;
}
.nav-menu a:hover::after { width: 100%; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.lang-switch { display: flex; align-items: center; gap: 0.4rem; }
.lang-switch a { color: var(--gray-medium); font-size: 0.9rem; font-weight: 600; padding: 0.2rem 0.4rem; }
.lang-switch a:hover { color: var(--white); }
.lang-switch a.active { color: var(--white); }
.lang-sep { color: var(--gray-dark); }
.cta-button {
  padding: 0.6rem 1.3rem; background-color: var(--white); color: var(--black) !important;
  border-radius: 6px; font-weight: 600; font-size: 0.9rem;
}
.cta-button:hover { background-color: var(--gray-light); color: var(--black) !important; transform: translateY(-2px); }

/* ---------- Layout ---------- */
.blog-main { max-width: 820px; margin: 0 auto; padding: 7rem 1.5rem 4rem; }
.blog-wide { max-width: 1200px; }
.breadcrumb { font-size: 0.85rem; color: var(--gray-medium); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--gray-medium); }
.breadcrumb a:hover { color: var(--white); }

/* ---------- Blog index ---------- */
.blog-hero { text-align: center; padding: 7rem 1.5rem 2rem; max-width: 800px; margin: 0 auto; }
.blog-hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; letter-spacing: -1px; margin-bottom: 1rem; }
.blog-hero p { font-size: 1.15rem; color: var(--gray-medium); }
.posts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.8rem; max-width: 1200px; margin: 2rem auto 0; padding: 0 1.5rem;
}
.post-card {
  background-color: var(--black-light); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; overflow: hidden; transition: var(--transition); display: flex; flex-direction: column;
}
.post-card:hover { border-color: rgba(255,255,255,0.3); transform: translateY(-5px); }
.post-card a { color: inherit; display: flex; flex-direction: column; height: 100%; }
.post-card-img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: #111; }
.post-card-body { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.post-tag {
  align-self: flex-start; font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--accent-blue); background: rgba(74,144,226,0.1);
  border: 1px solid rgba(74,144,226,0.25); padding: 0.2rem 0.6rem; border-radius: 20px;
}
.post-card-body h2 { font-size: 1.2rem; font-weight: 700; line-height: 1.35; color: var(--white); }
.post-card-body p { color: var(--gray-medium); font-size: 0.92rem; flex: 1; }
.post-card-meta { color: var(--gray-dark); font-size: 0.8rem; margin-top: auto; }

/* ---------- Article ---------- */
.article-header { margin-bottom: 2rem; }
.article-header .post-tag { margin-bottom: 1rem; }
.article-header h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.5px; margin-bottom: 1rem; }
.article-meta { display: flex; align-items: center; gap: 0.8rem; color: var(--gray-medium); font-size: 0.9rem; flex-wrap: wrap; }
.article-meta .dot { color: var(--gray-dark); }
.article-hero-img { width: 100%; border-radius: 14px; margin: 1.5rem 0 2.5rem; border: 1px solid rgba(255,255,255,0.1); }
.article-lead { font-size: 1.2rem; color: var(--gray-light); line-height: 1.7; margin-bottom: 2rem; font-weight: 300; }

.article-body { font-size: 1.05rem; color: var(--gray-light); }
.article-body h2 { font-size: 1.6rem; font-weight: 700; color: var(--white); margin: 2.5rem 0 1rem; letter-spacing: -0.3px; }
.article-body h3 { font-size: 1.25rem; font-weight: 600; color: var(--white); margin: 2rem 0 0.8rem; }
.article-body p { margin-bottom: 1.3rem; }
.article-body ul, .article-body ol { margin: 0 0 1.3rem 1.2rem; }
.article-body ul li { list-style: none; position: relative; padding-left: 1.5rem; margin-bottom: 0.7rem; }
.article-body ul li::before { content: '▸'; position: absolute; left: 0; color: var(--accent-blue); font-weight: 700; }
.article-body ol { list-style: decimal; margin-left: 1.6rem; }
.article-body ol li { margin-bottom: 0.7rem; padding-left: 0.3rem; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body strong { color: var(--white); font-weight: 600; }
.article-body img { border-radius: 12px; margin: 2rem 0; border: 1px solid rgba(255,255,255,0.1); }
.article-body figure { margin: 2rem 0; }
.article-body figcaption { text-align: center; color: var(--gray-medium); font-size: 0.85rem; margin-top: 0.6rem; font-style: italic; }
.article-body blockquote {
  border-left: 4px solid var(--accent-blue); background: rgba(74,144,226,0.06);
  padding: 1rem 1.4rem; margin: 1.8rem 0; border-radius: 0 8px 8px 0; color: var(--gray-light);
}

/* Callout boxes */
.callout {
  display: flex; gap: 0.9rem; padding: 1.1rem 1.3rem; border-radius: 10px; margin: 1.8rem 0;
  border: 1px solid rgba(255,255,255,0.1); background: var(--black-light); line-height: 1.6;
}
.callout i { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.callout.warn { border-color: rgba(255,189,46,0.35); background: rgba(255,189,46,0.07); }
.callout.warn i { color: #ffbd2e; }
.callout.danger { border-color: rgba(255,95,86,0.35); background: rgba(255,95,86,0.07); }
.callout.danger i { color: #ff5f56; }
.callout.tip { border-color: rgba(39,201,63,0.3); background: rgba(39,201,63,0.07); }
.callout.tip i { color: #27c93f; }
.callout.info { border-color: rgba(74,144,226,0.3); background: rgba(74,144,226,0.07); }
.callout.info i { color: var(--accent-blue); }
.callout strong { color: var(--white); }

/* Code */
.article-body pre {
  background: var(--black-light); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
  padding: 1.2rem 1.4rem; overflow-x: auto; margin: 1.6rem 0;
}
.article-body pre code { font-family: 'SF Mono','Monaco','Consolas',monospace; font-size: 0.88rem; color: var(--gray-light); line-height: 1.6; }
.article-body :not(pre) > code {
  font-family: 'SF Mono','Monaco','Consolas',monospace; font-size: 0.88em;
  background: rgba(255,255,255,0.08); padding: 0.15em 0.4em; border-radius: 4px; color: #ffd9a0;
}

/* Tables */
.article-body table { width: 100%; border-collapse: collapse; margin: 1.8rem 0; font-size: 0.95rem; }
.article-body th, .article-body td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.article-body th { color: var(--white); font-weight: 600; background: rgba(255,255,255,0.03); }
.article-body td { color: var(--gray-light); }

/* TL;DR box */
.tldr { background: linear-gradient(135deg, rgba(74,144,226,0.1), transparent); border: 1px solid rgba(74,144,226,0.25); border-radius: 12px; padding: 1.3rem 1.5rem; margin-bottom: 2.5rem; }
.tldr h2 { font-size: 0.8rem !important; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-blue) !important; margin: 0 0 0.6rem !important; }
.tldr p { margin-bottom: 0; color: var(--gray-light); }

/* CTA block */
.post-cta {
  margin: 3rem 0 1rem; padding: 2rem; text-align: center; border-radius: 16px;
  background: linear-gradient(135deg, rgba(74,144,226,0.12), rgba(139,126,200,0.06));
  border: 1px solid rgba(74,144,226,0.25);
}
.post-cta h3 { font-size: 1.5rem; color: var(--white); margin-bottom: 0.6rem; }
.post-cta p { color: var(--gray-medium); margin-bottom: 1.3rem; }
.post-cta .cta-button { display: inline-block; padding: 0.9rem 2rem; font-size: 1rem; }

/* Author / share */
.article-footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 1rem; }
.author-avatar { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple)); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.author-info strong { color: var(--white); display: block; font-size: 0.95rem; }
.author-info span { color: var(--gray-medium); font-size: 0.85rem; }

.related { margin-top: 3.5rem; }
.related h2 { font-size: 1.4rem; margin-bottom: 1.2rem; }

/* ---------- Footer (clon) ---------- */
.footer { background-color: var(--black); border-top: 1px solid rgba(255,255,255,0.1); padding: 3rem 2rem 2rem; margin-top: 4rem; }
.footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-logo-img { height: 42px; margin-bottom: 1rem; }
.footer-section p { color: var(--gray-medium); font-size: 0.92rem; }
.footer-section h4 { font-size: 1.05rem; margin-bottom: 1rem; color: var(--white); }
.footer-links { display: flex; flex-direction: column; gap: 0.7rem; }
.footer-links li a, .footer-links li { color: var(--gray-medium); font-size: 0.92rem; display: flex; align-items: center; gap: 0.5rem; }
.footer-links a:hover { color: var(--white); }
.footer-bottom { max-width: 1200px; margin: 0 auto; text-align: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); color: var(--gray-medium); font-size: 0.88rem; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-menu { display: none; }
  .blog-main { padding-top: 6rem; }
  .article-body { font-size: 1rem; }
}

/* ============================================
   REGISTRATION MODAL (copiado de styles.css)
   ============================================ */

/* Reset de botones para el modal (blog.css no tiene reset global) */
.registration-modal button,
button.cta-button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.registration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background-color: var(--black-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    color: var(--gray-medium);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.modal-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-header h2 {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--white);
}

.modal-subtitle {
    color: var(--gray-medium);
    font-size: 0.875rem;
}

.registration-form .form-group {
    margin-bottom: 1.25rem;
}

.registration-form label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: var(--white);
}

.registration-form .required {
    color: #ff6b6b;
}

.registration-form input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    background-color: var(--black);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.9rem;
    transition: var(--transition);
}

.registration-form input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.registration-form input::placeholder {
    color: var(--gray-dark);
}

.registration-form input.error {
    border-color: #ff6b6b;
}

.error-message {
    display: none;
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

.error-message.visible {
    display: block;
}

/* Language Selector - Compact Inline Version */
.language-field-group {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    margin-top: -0.25rem;
}

.language-selector-group-compact {
    position: relative;
    display: flex;
    gap: 0;
    background-color: var(--black);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 4px;
    overflow: hidden;
    max-width: 400px;
}

.language-selector-slider-compact {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: calc(33.333% - 5.33px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.language-option-compact {
    position: relative;
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--gray-medium);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    z-index: 2;
    border-radius: 8px;
}

.language-option-compact .lang-flag-icon {
    font-size: 0.9rem;
    line-height: 1;
    border-radius: 2px;
    opacity: 0.5;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.language-option-compact .lang-text {
    font-weight: 500;
    font-size: 0.72rem;
    transition: all 0.3s ease;
}

.language-option-compact:hover {
    color: var(--gray-light);
}

.language-option-compact:hover .lang-flag-icon {
    opacity: 0.75;
    transform: scale(1.05);
}

.language-option-compact.active {
    color: var(--white);
}

.language-option-compact.active .lang-flag-icon {
    opacity: 1;
    transform: scale(1.1);
}

.language-option-compact.active .lang-text {
    font-weight: 600;
}

.form-actions {
    margin-top: 1.5rem;
}

.btn-submit {
    width: 100%;
    padding: 0.9rem;
    background-color: var(--white);
    color: var(--black);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover:not(:disabled) {
    background-color: var(--gray-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

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

.spin {
    animation: spin 1s linear infinite;
}

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

/* Checkbox Styles */
.form-checkbox-group {
    margin-bottom: 1.5rem;
}

.form-checkbox-group .error-message {
    display: none;
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 107, 107, 0.1);
    border-left: 3px solid #ff6b6b;
    border-radius: 4px;
    font-weight: 500;
}

.form-checkbox-group .error-message.visible {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.checkbox-wrapper {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    position: absolute;
    top: 2px;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: var(--black);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: var(--transition);
}

.checkbox-wrapper:hover .checkbox-custom {
    border-color: var(--accent-blue);
}

.checkbox-wrapper input:checked ~ .checkbox-custom {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.checkbox-custom::after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-wrapper input:checked ~ .checkbox-custom::after {
    display: block;
}

.checkbox-label {
    font-size: 0.9rem;
    color: var(--gray-light);
    line-height: 1.6;
}

.checkbox-label a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition);
}

.checkbox-label a:hover {
    color: var(--white);
    text-decoration: underline;
}

.checkbox-wrapper.error .checkbox-custom {
    border-color: #ff6b6b;
}

/* Success State */
.registration-success {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    font-size: 4rem;
    color: #4caf50;
    margin-bottom: 1rem;
    animation: scaleIn 0.5s ease;
}

.registration-success h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.registration-success p {
    color: var(--gray-medium);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.email-sent {
    color: var(--white);
    font-weight: 600;
    font-size: 1.05rem;
}

.success-help {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 8px;
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        padding: 2rem 1.5rem;
        max-height: 95vh;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }
}
