:root {
    --primary: #0b2e59;
    --accent: #1da1f2;
    --bg: #f0f2f5;
    --text: #1c1e21;
    --card: #ffffff;
    --border: #dddfe2;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.btn-hub {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: #65676b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}
.btn-hub:hover { background: #f1f5f9; color: var(--text); }

header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-placeholder {
    font-size: 3rem;
    margin-bottom: 10px;
}

h1 {
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.main-actions {
    margin-bottom: 40px;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 18px 36px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 12px rgba(11, 46, 89, 0.2);
}

.btn-primary:hover {
    background-color: #144985;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: wait;
}

.status-msg {
    margin-top: 15px;
    font-weight: 600;
    color: var(--primary);
    animation: pulse 1.5s infinite;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.card {
    background: var(--card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
}

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

.card h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.3rem;
}

.badge {
    background: #e7f3ff;
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge.highlight {
    background: #fff0e0;
    color: #ff8e1a;
}

textarea {
    width: 100%;
    height: 200px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.img-preview img {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.btn-copy, .btn-download {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-copy { background: #e1e8ed; color: #1c1e21; }
.btn-download { background: #27ae60; color: white; margin-top: 10px; }

/* Selector de cantidad de localidades para el texto del tweet */
.text-count-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    padding: 0.5rem 0.7rem;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.85rem;
}
.text-count-row.hidden { display: none; }
.text-count-label {
    color: #475569;
    font-weight: 500;
}
.text-count-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.text-count-btn:hover:not(:disabled) { background: #e0e7ff; }
.text-count-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.text-count-value {
    min-width: 1.5rem;
    text-align: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}
.text-count-max {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-left: auto;
}

.hint {
    font-size: 0.8rem;
    color: #65676b;
    margin: 6px 0 10px 0;
}
.actions-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.actions-row .btn-copy,
.actions-row .btn-publish {
    margin-top: 0;
    flex: 1;
}
.btn-publish {
    display: block;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: var(--accent);
    color: white;
    transition: background 0.2s;
}
.btn-publish:hover:not(:disabled) { background: #1a91da; }
.btn-publish:disabled { background: #b5d8eb; cursor: not-allowed; }

.publish-status {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}
.publish-status.uploading {
    background: #fff4e6;
    border: 1px solid #ffd99c;
    color: #7a4500;
}
.publish-status.success {
    background: #e7f7ec;
    border: 1px solid #a5dfb6;
    color: #186829;
}
.publish-status.success a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
}
.publish-status.error {
    background: #fdecea;
    border: 1px solid #f5b0a8;
    color: #8a1a10;
}

/* Video Section */
.video-card {
    text-align: center;
}

.video-loader {
    padding: 60px 20px;
    background: #fafafa;
    border-radius: 12px;
}

.spinner-editorial {
    width: 50px;
    height: 50px;
    border: 5px solid #eee;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

#videoContent video {
    width: 100%;
    max-height: 500px;
    border-radius: 12px;
}

.hidden { display: none !important; }

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

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