/* ===== VARIABLES ===== */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #ffffff;
    --accent-hover: #e0e0e0;
    --border: #222222;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

/* ===== BUTTONS ===== */
button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

button.primary {
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
}

button.primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.logo-img {
    height: 32px;
    width: auto;
    display: block;
}

/* ===== supporter link ===== */
.supporter-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
    border-bottom: 1px dotted var(--border);
}

.supporter-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent-hover);
}

.supporter-list {
    margin-top: 0.5rem;
    padding-left: 1.2rem;
    list-style: none;
    padding: 0;
}

.supporter-list li {
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
}

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th {
    text-align: left;
    padding: 1rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

/* ===== FORMS ===== */
input, select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    width: 100%;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--text-primary);
}

input::placeholder {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== NAVIGATION ===== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
}

.top-bar > div:first-child {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--text-primary);
}

/* ===== PLATFORM ICONS ===== */
.platform-icons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin: 0.8rem 0;
    flex-wrap: wrap;
}

.platform-icon {
    height: 32px;
    width: auto;
    opacity: 0.6;
    transition: opacity 0.2s;
    filter: invert(1); /* Para que se vean blancos */
}

.platform-icon:hover {
    opacity: 1;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== LOADER ===== */
.loader {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== TOOLTIPS ===== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    border: 1px solid var(--border);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 0.5rem;
    z-index: 10;
}

[data-tooltip]:hover:before {
    opacity: 1;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--border);
}

.badge-free {
    background: transparent;
    border-color: var(--border);
}

.badge-basic {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-primary);
}

.badge-pro {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.badge-unlimited {
    background: var(--text-primary);
    color: var(--bg-primary);
}

/* ===== SUCCESS CARD (ESTILO SUPABASE) ===== */
.success-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: left;
}

.success-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin: 1.5rem 0;
    font-weight: 400;
}

/* ===== INFO GRID (ESTILO SUPABASE) ===== */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.info-item {
    background: transparent;
    border: none;
    padding: 0;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.info-value {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin: 0.5rem 0;
    word-break: break-all;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Botón de copia estilo Supabase */
.copy-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.copy-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* ===== API INFO (ESTILO SUPABASE) ===== */
.api-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.api-info h3 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    font-weight: 500;
}

.api-info p {
    background: var(--bg-primary);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.api-info .note {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1rem;
    background: transparent;
    border: none;
    padding: 0;
}

/* ===== SECURITY NOTE ===== */
.security-note {
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 1rem 1rem;
    margin-top: 3rem;
    width: 100%;
    overflow-x: hidden;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.footer-section h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0;
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    transition: color 0.2s;
}

.footer-bottom {
    max-width: 1200px;
    margin: 1.5rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}


/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    .top-bar > div:first-child {
        justify-content: center;
    }
    
    .top-bar > div:last-child {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.9rem;
    }
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .platform-icons {
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .platform-icon {
        height: 22px;
    }
    
    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .toast {
        max-width: 100%;
    }
    
    .card {
        padding: 1.5rem;
    }

    .table-container {
        margin: 1rem -1rem;
        width: calc(100% + 2rem);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    table {
        min-width: 500px;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .docs table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .docs,
    .faq-container,
    .features-container,
    .legal-container {
        padding: 1rem;
        width: 100%;
        overflow-x: hidden;
    }
    
    .card,
    .success-card,
    .api-info {
        padding: 1rem;
        margin: 1rem -0.5rem;
        width: calc(100% + 1rem);
    }

    .footer {
        padding: 1.5rem 0.75rem 0.75rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        text-align: left;
    }
    
    .footer-section:first-child {
        grid-column: span 2;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .footer-section h4 {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .footer-section a {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .top-bar > div:last-child {
        gap: 0.75rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo-img {
        height: 24px;
    }
    .pagination {
        flex-wrap: wrap;
    }
    
    button {
        width: 100%;
    }

    .platform-icons {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .platform-icon {
        height: 18px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.25rem;
    }
    
    .footer-section:first-child {
        grid-column: span 1;
    }
    
    .footer-section a {
        margin-bottom: 0.35rem;
    }
}