@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700&display=swap');

:root {
    --primary: #7c4dff;
    --primary-glow: rgba(124, 77, 255, 0.4);
    --secondary: #448aff;
    --bg-dark: #0a0b1e;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --text-white: #ffffff;
    --text-main: #e0e0e0;
    --text-muted: #9e9e9e;
    --text-gray: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --success: #10b981;
    --error: #ef4444;
    --accent: #ffca28;
    --warning: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] {
    --primary: #6200ea;
    --primary-glow: rgba(98, 0, 234, 0.3);
    --secondary: #2962ff;
    --bg-dark: #f1f5f9;
    /* Slate 100 */
    --surface: #ffffff;
    --surface-hover: #e2e8f0;
    --border: #cbd5e1;
    --text-white: #1e293b;
    /* Slate 800 */
    --text-main: #334155;
    /* Slate 700 */
    --text-muted: #64748b;
    --text-gray: #475569;
    --card-bg: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.05);
    --bg-image: none;
    /* Simplifies light mode background */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: var(--bg-image,
            radial-gradient(circle at 10% 20%, rgba(124, 77, 255, 0.1) 0%, transparent 40%),
            radial-gradient(circle at 90% 80%, rgba(68, 138, 255, 0.1) 0%, transparent 40%),
            radial-gradient(circle at top left, #1e1b4b, #0f172a));
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-white);
}

a {
    transition: all 0.3s ease;
}

/* Layout */
.portal-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

main {
    grid-column: 2;
    padding: 2.5rem 3.5rem;
    width: 100%;
    max-width: 1500px;
    margin: 0;
}

header.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.header-title h1 {
    font-size: 2.2rem;
    background: linear-gradient(to right, var(--text-white), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    border: 1px solid var(--border);
}

/* Sidebar Styles */
header.mobile-header {
    display: none;
    background: var(--bg-dark);
    /* Fallback */
    background: color-mix(in srgb, var(--bg-dark), transparent 5%);
    /* Approx 0.95 opacity */
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    justify-content: space-between;
    align-items: center;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1100;
    /* Higher than header and overlay */
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-white);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Hamburger Animation */
.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

aside {
    grid-column: 1;
    background: var(--bg-dark);
    background: color-mix(in srgb, var(--bg-dark), transparent 20%);
    /* Approx 0.8 opacity */
    backdrop-filter: blur(15px);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

/* Sidebar Scrollbar Styling (Premium Look) */
aside::-webkit-scrollbar {
    width: 5px;
}

aside::-webkit-scrollbar-track {
    background: transparent;
}

aside::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

aside:hover::-webkit-scrollbar-thumb {
    background: var(--primary-glow);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.logo i {
    color: var(--primary);
    filter: drop-shadow(0 0 5px var(--primary-glow));
}

nav ul {
    list-style: none;
}

nav li {
    margin-bottom: 0.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 500;
}

nav a:hover,
nav a.active {
    color: var(--text-white);
    background: var(--surface);
}

nav a.active {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    box-shadow: 0 4px 15px var(--primary-glow);
    color: #ffffff;
}

body.light-mode nav a.active {
    background: linear-gradient(90deg, #b17aff, #779bfb);
    box-shadow: 0 4px 15px rgba(119, 155, 251, 0.4);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}

/* Info Cards & Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.info-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.info-label {
    color: var(--text-gray);
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-white);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 20px;
}

/* Tables Global */
.table-container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 32px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-gray);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    color: var(--text-main);
    font-size: 14px;
}

tr:last-child td {
    border-bottom: none;
}

@media (max-width: 768px) {
    .table-responsive {
        width: 100%;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
        /* Force scroll */
    }

    th,
    td {
        padding: 12px 10px;
        font-size: 13px;
    }
}

.status-badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-expired {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* Dashboard Specific Grid & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    /* Increased visibility */
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.stat-card i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-white);
    display: block;
}

.stat-label {
    color: var(--text-gray);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Keyword Queue & Article Generator Layout */
.grid-main {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .grid-main {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 15px 35px -15px rgba(0, 0, 0, 0.5);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-pending {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.action-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-gray);
    margin-right: 6px;
    font-size: 14px;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--primary-glow);
}

.btn-delete:hover {
    background: var(--error);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

/* Product Cards */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

/* Form Elements Premium */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-gray);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-left: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-white);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    backdrop-filter: blur(8px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.15);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: var(--surface-hover);
    box-shadow: 0 0 0 1px var(--primary), 0 8px 16px -4px rgba(124, 77, 255, 0.2);
    transform: translateY(-2px);
}

select option {
    background-color: var(--bg-dark);
    color: var(--text-white);
}

/* Global Form Elements for non-form-group usage */
textarea,
select,
input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-white);
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

textarea:focus,
select:focus,
input:focus {
    border-color: var(--primary);
    background: var(--surface-hover);
}

/* Chrome/Safari khusus styling date picker icon */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.5;
    cursor: pointer;
}

.input-with-action {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-with-action input {
    flex: 1;
}

.btn-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px) rotate(15deg);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.action-btn {
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-gray);
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
}

.action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--primary-glow);
}

.btn-submit-premium {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 16px 32px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 25px -5px var(--primary-glow);
    color: #ffffff;
}

.btn-submit-premium:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px -5px var(--primary-glow);
}

/* Generic Bits */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.alert {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 24px;
    border: 1px solid;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

.avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

/* Auth Specific */
.auth-container {
    width: 100%;
    max-width: 750px;
    margin: 3vh auto;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    padding: 80px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.5);
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 80px;
    border-radius: 40px;
    max-width: 750px;
    width: 100%;
    text-align: center;
    margin: 0 auto;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.5);
}

.auth-footer {
    margin-top: 20px;
}

.auth-footer a {
    text-decoration: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .portal-container {
        grid-template-columns: 1fr;
        padding-top: 70px;
    }

    header.mobile-header {
        display: flex;
    }

    aside {
        position: fixed;
        left: -260px;
        width: 260px;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1002;
    }

    aside.open {
        left: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }

    main {
        grid-column: 1 / -1;
        padding: 1.5rem;
        /* Prevent horizontal scroll on body caused by wide children */
        overflow-x: hidden;
    }

    /* Stack header on mobile */
    header.dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .user-profile {
        width: 100%;
        justify-content: flex-start;
    }
}

}

/* =========================================================================
   CUSTOM ARTICLE COMPONENTS (Editor Shortcode Output)
   ========================================================================= */

/* Stat Container */
.stat-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
}

.stat-item {
    flex: 1;
    min-width: 150px;
    text-align: center;
}

.stat-item .stat-value {
    display: block;
    font-size: 2.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-item .stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* Comparison Table */
.table-responsive .comparison-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
}

table.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin: 2rem 0;
}

table.comparison-table thead {
    background: rgba(255, 255, 255, 0.05);
}

table.comparison-table th {
    padding: 1.25rem 1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-white);
    text-align: left;
    border-bottom: 2px solid var(--border);
    font-size: 1.1rem;
    text-transform: none;
    letter-spacing: 0;
}

table.comparison-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-weight: 400;
    font-size: 0.95rem;
}

table.comparison-table tbody tr {
    transition: background 0.3s;
}

table.comparison-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

table.comparison-table tr:last-child td {
    border-bottom: none;
}

/* Pricing Cards */
.pricing-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.pricing-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px -10px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.2);
}

.pricing-card.highlighted {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
    transform: scale(1.03);
    z-index: 2;
}

.pricing-card.highlighted::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.pricing-card.highlighted:hover {
    transform: scale(1.05) translateY(-8px);
}

.pricing-card h3 {
    margin-top: 0;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--text-white);
}

.pricing-card p {
    color: var(--text-gray);
    margin-bottom: 2rem;
    flex-grow: 1;
    font-size: 0.95rem;
    line-height: 1.6;
}

.pricing-card .price {
    display: block;
    font-size: 1.8rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--primary);
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}