:root {
    --bg-dark: #07070c;
    --panel-bg: rgba(15, 15, 27, 0.7);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f3f6;
    --text-secondary: #a0a0ba;
    --primary: #9d4edd;
    --primary-glow: rgba(157, 78, 221, 0.4);
    --secondary: #00f5d4;
    --secondary-glow: rgba(0, 245, 212, 0.3);
    --danger: #ff0054;
    --success: #390099; /* custom dark purple success */
    --neon-success: #00f5d4;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Background blob effects */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(130px);
    opacity: 0.25;
}

.blob-1 {
    top: -10%;
    right: 10%;
    width: 40vw;
    height: 40vw;
    background: var(--primary);
    animation: pulse 12s infinite alternate;
}

.blob-2 {
    bottom: -10%;
    left: 10%;
    width: 45vw;
    height: 45vw;
    background: #5a189a;
    animation: pulse 15s infinite alternate-reverse;
}

.blob-3 {
    top: 40%;
    left: 50%;
    width: 30vw;
    height: 30vw;
    background: var(--secondary);
    animation: pulse 18s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(3%, 5%); }
}

/* App Wrapper Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: rgba(10, 10, 18, 0.85);
    border-right: 1px solid var(--panel-border);
    backdrop-filter: blur(20px);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #000;
    box-shadow: 0 0 15px var(--primary-glow);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition);
}

.menu-item a:hover, .menu-item.active a {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.menu-item.active a {
    background: linear-gradient(90deg, rgba(157, 78, 221, 0.15) 0%, rgba(0, 245, 212, 0.03) 100%);
    border: 1px solid rgba(157, 78, 221, 0.3);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #3e3d56;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    border: 2px solid var(--primary);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.user-plan-badge {
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 700;
    text-transform: uppercase;
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 2.5rem 3.5rem;
    min-height: 100vh;
}

.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.page-title h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-title p {
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Glassmorphic Panel/Card */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--secondary);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

.stat-card:nth-child(2) .stat-icon { color: var(--primary); }
.stat-card:nth-child(3) .stat-icon { color: #f72585; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: 0.15rem;
}

/* AI Post Builder Form & Live Preview split layout */
.split-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1200px) {
    .split-layout {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-control, select, textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.2);
}

/* Dynamic social checkbox tags */
.checkbox-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
}

.checkbox-tile-wrapper {
    position: relative;
}

.checkbox-tile-wrapper input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.checkbox-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
    text-align: center;
}

.checkbox-tile-wrapper input:checked + .checkbox-tile {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.1) 0%, rgba(0, 245, 212, 0.05) 100%);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.15);
}

/* Custom interactive buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #7b2cbf 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--primary-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: #fff;
    border-radius: 12px;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #c1121f 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    transform: translateY(-2px);
}

/* Card tabs for Live Social Previews */
.preview-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--panel-border);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

.preview-tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    text-transform: capitalize;
}

.preview-tab-btn.active, .preview-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.social-preview-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    min-height: 250px;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
}

.wordpress-preview-card {
    background: #fff;
    color: #333;
    border-radius: 16px;
    padding: 2rem;
    min-height: 350px;
    font-family: 'Georgia', serif;
    overflow-y: auto;
    max-height: 500px;
}

.wordpress-preview-card h1 { font-size: 2rem; margin-bottom: 1rem; color: #111; font-family: sans-serif; }
.wordpress-preview-card h2 { font-size: 1.5rem; margin: 1.5rem 0 0.75rem 0; color: #222; font-family: sans-serif; }
.wordpress-preview-card p { margin-bottom: 1.25rem; font-size: 1.1rem; line-height: 1.6; }
.wordpress-preview-card ul { margin-left: 1.5rem; margin-bottom: 1.25rem; }
.wordpress-preview-card li { margin-bottom: 0.5rem; font-size: 1.1rem; }

/* Connected platforms configuration grid */
.connections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.connection-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 180px;
}

.connection-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.connection-title {
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: capitalize;
}

.connection-status {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-weight: 700;
}

.connection-status.active {
    background: rgba(0, 245, 212, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(0, 245, 212, 0.2);
}

.connection-status.inactive {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.connection-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* History logs list table */
.log-table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--panel-border);
}

td {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
}

.badge-posted {
    background: rgba(0, 245, 212, 0.12);
    color: var(--secondary);
}

.badge-scheduled {
    background: rgba(157, 78, 221, 0.15);
    color: var(--primary);
}

.badge-draft {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.badge-failed {
    background: rgba(255, 0, 84, 0.12);
    color: var(--danger);
}

.badge-posting {
    background: rgba(255, 179, 0, 0.12);
    color: #ffb300;
}

/* Plans subscription selector design */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.plan-card {
    display: flex;
    flex-direction: column;
    padding: 3rem 2.25rem;
    height: 100%;
    transition: var(--transition);
}

.plan-card.current {
    border-color: var(--primary);
    box-shadow: 0 0 25px rgba(157, 78, 221, 0.2);
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 3rem;
    font-weight: 900;
    margin: 1.5rem 0;
    display: flex;
    align-items: baseline;
}

.plan-price span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.plan-features {
    list-style: none;
    margin-top: 2rem;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.plan-features li::before {
    content: '✓';
    color: var(--secondary);
    font-weight: bold;
}

/* Sandbox Payment Terminal layout */
.sandbox-card {
    max-width: 500px;
    margin: 5rem auto;
    text-align: center;
}

.sandbox-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.sandbox-device {
    background: #000;
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 245, 212, 0.1);
}

.sandbox-line {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.sandbox-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px dotted rgba(255, 255, 255, 0.2);
}

/* Alert system notifications */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(0, 245, 212, 0.12);
    color: var(--secondary);
    border: 1px solid rgba(0, 245, 212, 0.2);
}

.alert-danger {
    background: rgba(255, 0, 84, 0.12);
    color: var(--danger);
    border: 1px solid rgba(255, 0, 84, 0.2);
}

/* Progress bar UI */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: var(--transition);
}

/* Dashboard social card preview styling */
.channel-pill {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-right: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
}

.pill-linkedin { background: rgba(10, 102, 194, 0.15); color: #0a66c2; }
.pill-facebook { background: rgba(24, 119, 242, 0.15); color: #1877f2; }
.pill-twitter { background: rgba(255, 255, 255, 0.1); color: #fff; }
.pill-wordpress { background: rgba(33, 117, 155, 0.15); color: #21759b; }

.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #0f0f1b;
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--card-shadow);
}
