/* ========================================
   WordPress Admin Bar Fix
   ======================================== */

/* Hide WordPress admin bar untuk subscriber/customer */
body.logged-in.page-template-page-dashboard #wpadminbar {
    display: none !important;
}

/* Reset top margin jika admin bar dihide */
body.logged-in.page-template-page-dashboard {
    margin-top: 0 !important;
}

body.admin-bar.page-template-page-dashboard .jz-dashboard-page {
    margin-top: 0 !important;
}

/* Alternative: Reposition admin bar ke bottom untuk admin/editor */
body.admin-bar.user-role-administrator #wpadminbar,
body.admin-bar.user-role-editor #wpadminbar {
    position: fixed;
    top: auto;
    bottom: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.98) 0%, rgba(31, 41, 55, 0.98) 100%);
    backdrop-filter: blur(20px);
}

body.admin-bar.user-role-administrator .jz-dashboard-page,
body.admin-bar.user-role-editor .jz-dashboard-page {
    margin-top: 0 !important;
    padding-bottom: 32px;
}

/* ========================================
   Dashboard Layout
   ======================================== */

.jz-dashboard-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
    position: relative;
}

.dashboard-hero {
    position: relative;
    padding: 60px 20px 40px; /* Extra top padding untuk breathing room */
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 107, 53, 0.1);
    margin-top: 0; /* Reset margin */
}

.dashboard-hero__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.08) 0%, rgba(255, 152, 0, 0.04) 100%);
}

.dashboard-hero__gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.1), transparent 50%);
}

.dashboard-hero__content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-hero__content h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.dashboard-hero__content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.dashboard-content {
    flex: 1;
    padding: 20px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ========================================
   Dashboard Sidebar Navigation
   ======================================== */

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
}

.dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
    position: sticky;
    top: 20px;
}

.dashboard-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 13px;
    border: 1px solid transparent;
}

.dashboard-nav__item:hover {
    background: rgba(255, 107, 53, 0.15);
    color: #fff;
    border-color: rgba(255, 107, 53, 0.3);
}

.dashboard-nav__item.is-active {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.25), rgba(255, 152, 0, 0.15));
    color: #fff;
    border: 1px solid rgba(255, 107, 53, 0.4);
}

.dashboard-nav__item .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 1.5;
}

.dashboard-nav__divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 6px 0;
}

.dashboard-nav__item--logout {
    color: rgba(255, 107, 107, 0.7);
}

.dashboard-nav__item--logout:hover {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
}

/* ========================================
   Dashboard Main Content
   ======================================== */

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dashboard-tab {
    display: none;
    opacity: 0;
}

.dashboard-tab.is-active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)) padding-box,
                linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 152, 0, 0.08)) border-box;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

.dashboard-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
}

.dashboard-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fff;
}

.dashboard-card p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    font-size: 14px;
}

/* ========================================
   Dashboard Stats
   ======================================== */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 107, 53, 0.08);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 10px;
    padding: 16px;
}

.stat-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.stat-content h3 {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.8);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #FF6B35;
}

/* ========================================
   Forms
   ======================================== */

.profile-form,
.change-password-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.form-group input,
.form-group textarea {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 107, 53, 0.6);
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.15);
}

.form-message {
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
    border: 1px solid transparent;
}

.form-message.error {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.4);
    color: #ff8787;
}

.form-message.success {
    background: rgba(81, 207, 102, 0.15);
    border-color: rgba(81, 207, 102, 0.4);
    color: #69db7c;
}

.form-message.loading {
    background: rgba(255, 152, 0, 0.15);
    border-color: rgba(255, 152, 0, 0.4);
    color: #ffa500;
}

.form-message {
    display: block;
}

.form-actions {
    display: flex;
    gap: 10px;
}

/* ========================================
   Settings
   ======================================== */

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.setting-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.setting-info h3 {
    font-size: 14px;
    margin-bottom: 3px;
}

.setting-info p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   Security
   ======================================== */

.security-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 16px;
}

.security-info h3 {
    font-size: 14px;
    margin-bottom: 3px;
}

.security-info p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

.security-item hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

/* ========================================
   Toggle Switch
   ======================================== */

.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.toggle-switch input {
    display: none;
}

.toggle {
    width: 48px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle {
    background: linear-gradient(135deg, #FF6B35, #FFA500);
    border-color: #FF6B35;
}

.toggle-switch input:checked + .toggle::before {
    left: 24px;
}

/* ========================================
   Orders List
   ======================================== */

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.order-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.order-info p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 3px;
}

.order-info p strong {
    color: #fff;
}

.order-status {
    display: inline-block;
    padding: 6px 10px;
    background: rgba(255, 107, 53, 0.2);
    border: 1px solid rgba(255, 107, 53, 0.4);
    color: #FF6B35;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 30px 20px;
    font-size: 14px;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #FF6B35 0%, #FFA500 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ========================================
   Mobile Responsive (768px and below)
   ======================================== */

@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dashboard-nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        padding: 8px;
        position: sticky;
        top: 0;
        z-index: 10;
        background: rgba(255, 255, 255, 0.03);
        backdrop-filter: blur(10px);
    }

    .dashboard-nav__item {
        flex-direction: column;
        gap: 4px;
        padding: 8px;
        font-size: 11px;
        justify-content: center;
        text-align: center;
    }

    .dashboard-nav__item span {
        line-height: 1.2;
    }

    .dashboard-nav__item.is-active {
        border: 1px solid rgba(255, 107, 53, 0.5);
    }

    .dashboard-card {
        padding: 16px;
    }

    .dashboard-card h2 {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .dashboard-hero__content h1 {
        font-size: 22px;
    }

    .dashboard-hero {
        padding: 30px 16px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        gap: 10px;
        padding: 12px;
    }

    .stat-icon {
        font-size: 24px;
    }

    .stat-content h3 {
        font-size: 11px;
    }

    .stat-value {
        font-size: 18px;
    }

    .setting-item,
    .security-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        width: 100%;
        padding: 10px 16px;
    }

    .order-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .dashboard-nav__divider {
        display: none;
    }
}

/* ========================================
   Mobile Responsive (480px and below)
   ======================================== */

@media (max-width: 480px) {
    .dashboard-content {
        padding: 12px;
    }

    .dashboard-layout {
        gap: 12px;
    }

    .dashboard-hero {
        padding: 20px 12px;
    }

    .dashboard-hero__content h1 {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .dashboard-hero__content p {
        font-size: 12px;
    }

    .dashboard-nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 3px;
        padding: 6px;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .dashboard-nav__item {
        padding: 6px 4px;
        font-size: 10px;
    }

    .dashboard-card {
        padding: 12px;
        border-radius: 10px;
    }

    .dashboard-card h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .dashboard-card h3 {
        font-size: 14px;
    }

    .profile-form,
    .change-password-form {
        gap: 12px;
    }

    .form-group label {
        margin-bottom: 4px;
        font-size: 12px;
    }

    .form-group input,
    .form-group textarea {
        padding: 8px 10px;
        font-size: 13px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 10px;
        gap: 8px;
    }

    .stat-icon {
        font-size: 20px;
    }

    .stat-value {
        font-size: 16px;
    }

    .setting-item,
    .security-item {
        padding: 12px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .form-actions {
        gap: 6px;
    }
}

/* ========================================
   Dashboard Sidebar Navigation
   ======================================== */

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
}


/* ========================================
   Main Content
   ======================================== */

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dashboard-tab {
    display: none;
    opacity: 0;
}

.dashboard-tab.is-active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}