/* Profile & Settings Theme */
:root {
    --sp-bg-main: #0b1120;
    --sp-bg-card: #151f32;
    --sp-bg-input: #0f1623;
    --sp-border: #1e293b;
    --sp-primary: #10b981;
    --sp-primary-hover: #059669;
    --sp-text-main: #f9fafb;
    --sp-text-muted: #9ca3af;
    --sp-toggle-off: #374151;
}

/* Main Container Override */
#settings-view {
    background-color: var(--sp-bg-main);
    padding: 0;
    height: 100%;
    overflow: hidden;
    /* Header fixed, content scrolls */
    display: flex;
    flex-direction: column;
}

/* Top Header */
.profile-header {
    background-color: var(--sp-bg-main);
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--sp-border);
}

.profile-title h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--sp-text-main);
    margin: 0;
}

.profile-title p {
    color: var(--sp-text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-preview {
    background: transparent;
    border: 1px solid var(--sp-border);
    color: var(--sp-text-main);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-preview:hover {
    border-color: var(--sp-text-muted);
}

.btn-save {
    background-color: var(--sp-primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save:hover {
    background-color: var(--sp-primary-hover);
}

/* Tabs Navigation */
.profile-tabs {
    display: flex;
    padding: 20px 40px 0;
    gap: 32px;
    background-color: var(--sp-bg-main);
    border-bottom: 1px solid var(--sp-border);
}

.tab-item {
    background: transparent;
    /* Force transparent */
    border: none;
    /* Remove default borders */
    padding: 12px 16px;
    color: var(--sp-text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    /* default */
    transition: all 0.2s;
    margin-bottom: -1px;
    /* Overlap border */
    font-family: inherit;
    /* Inherit font */
}

.tab-item:hover {
    color: var(--sp-text-main);
}

.tab-item.active {
    color: var(--sp-primary);
    border-bottom-color: var(--sp-primary);
    /* Alternative style: Pill shape as seen in image 1?
       Image 1 shows 'Información' as a big green button.
       Let's support that active state. */
}

/* Custom Tab Style (Pill/Button look for active) */
.tab-item.pill-active {
    background-color: rgba(16, 185, 129, 0.1);
    /* Subtle green bg */
    color: var(--sp-primary);
    border-radius: 8px 8px 0 0;
    /* Or full pill if detached */
}

/* For exact match to Image 1: The Active Tab is a filled green button */
/* This specific class overrides the default border-bottom style if applied */
.tab-item.btn-active-style {
    background-color: var(--sp-primary);
    color: #0b1120;
    /* Dark text on green */
    border-radius: 8px;
    padding: 8px 20px;
    font-weight: 600;
    border: none;
    margin-bottom: 12px;
    /* Lift off the line */
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    /* Add glow */
}


/* Scrollable Content Area */
.profile-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
    padding-bottom: 100px;
}

.profile-section {
    max-width: 1000px;
    margin: 0 auto;
    display: none;
    /* Hidden by default */
}

.profile-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.sp-card {
    background-color: var(--sp-bg-card);
    border: 1px solid var(--sp-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.sp-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.sp-icon-box {
    width: 40px;
    height: 40px;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--sp-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-card-title h3 {
    color: var(--sp-text-main);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.sp-card-title p {
    color: var(--sp-text-muted);
    font-size: 12px;
    margin: 2px 0 0;
}

/* Grid Layouts */
.sp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.sp-full-width {
    grid-column: span 2;
}

/* Form Groups */
.sp-form-group {
    margin-bottom: 0;
}

.sp-label {
    display: block;
    color: var(--sp-text-main);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.sp-input {
    width: 100%;
    background-color: var(--sp-bg-input);
    border: 1px solid var(--sp-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--sp-text-main);
    font-size: 14px;
    transition: border-color 0.2s;
}

.sp-input:focus {
    outline: none;
    border-color: var(--sp-primary);
}

.sp-input::placeholder {
    color: #4b5563;
}

/* Select */
.sp-select {
    width: 100%;
    background-color: var(--sp-bg-input);
    border: 1px solid var(--sp-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--sp-text-main);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

/* Textarea with counters */
.sp-textarea-wrapper {
    position: relative;
}

.sp-textarea {
    width: 100%;
    background-color: var(--sp-bg-input);
    border: 1px solid var(--sp-border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--sp-text-main);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 11px;
    color: var(--sp-text-muted);
}

/* Input Group (Prefix) */
.sp-input-group {
    display: flex;
    align-items: center;
    background-color: var(--sp-bg-input);
    border: 1px solid var(--sp-border);
    border-radius: 8px;
    overflow: hidden;
}

.sp-input-prefix {
    padding: 0 14px;
    color: var(--sp-text-muted);
    font-size: 14px;
    background-color: rgba(255, 255, 255, 0.02);
    border-right: 1px solid var(--sp-border);
    height: 42px;
    display: flex;
    align-items: center;
}

.sp-input-group .sp-input {
    border: none;
    background: transparent;
    flex: 1;
    /* Allow input to fill space */
}

.sp-input-suffix {
    padding: 0 14px;
    color: var(--sp-text-muted);
    font-size: 14px;
    background-color: rgba(255, 255, 255, 0.02);
    border-left: 1px solid var(--sp-border);
    height: 42px;
    display: flex;
    align-items: center;
}

/* Toggles */
.sp-toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.sp-toggle-label {
    display: flex;
    flex-direction: column;
}

.sp-toggle-text {
    font-weight: 500;
    color: var(--sp-text-main);
}

.sp-toggle-desc {
    font-size: 12px;
    color: var(--sp-text-muted);
}

.sp-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.sp-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sp-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--sp-toggle-off);
    border-radius: 24px;
    transition: .4s;
}

.sp-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.sp-switch input:checked+.sp-slider {
    background-color: var(--sp-primary);
}

.sp-switch input:checked+.sp-slider:before {
    transform: translateX(20px);
}

/* File Upload */
.sp-upload-box {
    border: 2px dashed var(--sp-border);
    border-radius: 12px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.01);
    transition: all 0.2s;
    min-height: 120px;
}

.sp-upload-box:hover {
    border-color: var(--sp-primary);
    background-color: rgba(16, 185, 129, 0.05);
}

.upload-icon {
    color: var(--sp-text-muted);
    margin-bottom: 8px;
}

.upload-text {
    color: var(--sp-text-main);
    font-size: 14px;
    font-weight: 500;
}

.upload-subtext {
    color: var(--sp-text-muted);
    font-size: 12px;
    margin-top: 4px;
}

/* Color Grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 8px;
}

.color-option {
    aspect-ratio: 1;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.color-option:hover {
    transform: scale(1.05);
}

.color-option.selected {
    border-color: var(--sp-text-main);
}

.color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 20px;
}

/* SEO Tip Box */
.seo-tip-box {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--sp-border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 24px;
}

.seo-icon {
    color: var(--sp-primary);
}

.seo-content h4 {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--sp-text-main);
}

.seo-content p {
    margin: 0;
    font-size: 12px;
    color: var(--sp-text-muted);
}