/**
 * LPK Core Public Styles
 */

/* Dashboard Layout */
.lpk-dashboard {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.lpk-dashboard-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.lpk-dashboard-content {
    flex: 1;
    min-width: 0;
}

/* Sidebar Navigation */
.lpk-sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.lpk-sidebar-nav li {
    border-bottom: 1px solid #f0f0f0;
}

.lpk-sidebar-nav li:last-child {
    border-bottom: none;
}

.lpk-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.lpk-sidebar-nav a:hover {
    background: #f8f9fa;
}

.lpk-sidebar-nav li.active a {
    background: #0073aa;
    color: #fff;
}

.lpk-sidebar-nav .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Cards */
.lpk-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.lpk-card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.lpk-card-header h3 {
    margin: 0;
}

/* Stats Grid */
.lpk-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.lpk-stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.lpk-stat-box h4 {
    margin: 0 0 5px;
    font-size: 28px;
}

.lpk-stat-box p {
    margin: 0;
    opacity: 0.9;
}

/* Buttons */
.lpk-button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.lpk-button-primary {
    background: #0073aa;
    color: #fff;
}

.lpk-button-primary:hover {
    background: #005a87;
    color: #fff;
}

.lpk-button-large {
    padding: 15px 30px;
    font-size: 16px;
}

/* Notices */
.lpk-notice {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.lpk-notice-info {
    background: #e7f4ff;
    border-left: 4px solid #0073aa;
}

.lpk-notice-warning {
    background: #fff8e5;
    border-left: 4px solid #f0b849;
}

.lpk-notice-error {
    background: #ffe7e7;
    border-left: 4px solid #dc3232;
}

/* Forms */
.lpk-form .lpk-form-row {
    margin-bottom: 20px;
}

.lpk-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.lpk-form input[type="text"],
.lpk-form input[type="email"],
.lpk-form input[type="tel"],
.lpk-form input[type="password"],
.lpk-form textarea,
.lpk-form select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.lpk-form input:focus,
.lpk-form textarea:focus,
.lpk-form select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.lpk-form .required {
    color: #dc3232;
}

/* Login Prompt */
.lpk-login-prompt {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.lpk-login-prompt h2 {
    margin-bottom: 10px;
}

.lpk-login-prompt p {
    margin-bottom: 20px;
    color: #666;
}

/* Checkout */
.lpk-checkout-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.lpk-checkout-product {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.lpk-checkout-product h3 {
    margin: 0 0 10px;
}

.lpk-product-price {
    font-size: 24px;
    color: #0073aa;
}

.lpk-form-section {
    margin-bottom: 30px;
}

.lpk-form-section h4 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.lpk-payment-gateways {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lpk-gateway-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

.lpk-gateway-option:hover {
    border-color: #0073aa;
}

.lpk-gateway-option input[type="radio"] {
    width: auto;
}

/* Products Grid */
.lpk-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.lpk-product-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s;
}

.lpk-product-card:hover {
    transform: translateY(-5px);
}

.lpk-product-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
}

.lpk-product-name {
    margin: 0 0 10px;
    font-size: 24px;
}

.lpk-price-amount {
    font-size: 32px;
    font-weight: bold;
}

.lpk-price-cycle {
    opacity: 0.9;
}

.lpk-product-body {
    padding: 20px;
}

.lpk-product-features {
    list-style: none;
    margin: 15px 0;
    padding: 0;
}

.lpk-product-features li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.lpk-product-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

/* Mobile Responsive Dashboard */
/* Mobile Header - Hidden on desktop, visible on mobile */
.lpk-mobile-header {
    display: none;
}

/* Desktop view - sidebar always visible, mobile header hidden */
@media screen and (min-width: 769px) {

    .lpk-mobile-header,
    .lpk-mobile-menu-toggle {
        display: none !important;
    }

    .lpk-dashboard-sidebar {
        display: block !important;
    }
}

/* Mobile view - hamburger menu */
@media screen and (max-width: 768px) {
    .lpk-dashboard {
        flex-direction: column;
        padding: 10px;
        gap: 15px;
    }

    /* Mobile Header - MUST show on mobile */
    .lpk-mobile-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        background: linear-gradient(135deg, #4f46e5, #7c3aed);
        color: #fff;
        padding: 15px 20px;
        border-radius: 12px;
        margin-bottom: 10px;
        box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    }

    .lpk-mobile-header h3 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .lpk-mobile-menu-toggle {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: #fff;
        width: 44px;
        height: 44px;
        border-radius: 10px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        transition: background 0.2s;
    }

    .lpk-mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    /* Sidebar as dropdown */
    .lpk-dashboard-sidebar {
        width: 100%;
        display: none;
        margin-bottom: 15px;
    }

    .lpk-dashboard-sidebar.open {
        display: block;
        animation: lpk-slideDown 0.3s ease-out;
    }

    @keyframes lpk-slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .lpk-sidebar-nav ul {
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }

    .lpk-sidebar-nav a {
        padding: 14px 18px;
    }

    .lpk-sidebar-nav li.active a {
        background: linear-gradient(135deg, #4f46e5, #7c3aed);
    }

    /* Content adjustments */
    .lpk-dashboard-content {
        width: 100%;
    }

    .lpk-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .lpk-stat-box {
        padding: 15px;
    }

    .lpk-stat-box h4 {
        font-size: 22px;
    }

    .lpk-card {
        border-radius: 12px;
        padding: 15px;
    }

    .lpk-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lpk-card-actions {
        width: 100%;
        margin-top: 10px;
    }

    /* Mobile Table with Horizontal Scroll */
    .lpk-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }

    .lpk-table,
    .lpk-users-table {
        font-size: 14px;
        min-width: 600px;
        width: max-content;
    }

    .lpk-table th,
    .lpk-table td,
    .lpk-users-table th,
    .lpk-users-table td {
        padding: 10px 12px;
        white-space: nowrap;
    }

    .lpk-table th,
    .lpk-users-table th {
        position: sticky;
        top: 0;
        background: #f8fafc;
        z-index: 1;
    }

    /* Scroll containers */
    .lpk-card-body,
    .lpk-users-table-container {
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lpk-card-body::after,
    .lpk-users-table-container::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.9));
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .lpk-card-body:has(.lpk-table)::after,
    .lpk-users-table-container::after {
        opacity: 1;
    }

    /* Mobile Form Improvements */
    .lpk-form-row {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px;
    }

    .lpk-form-row>label {
        margin-bottom: 5px;
        font-weight: 600;
    }

    .lpk-form-row-2 {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    /* Mobile Editor Improvements */
    #editor-visual,
    #editor-code {
        border-radius: 0 0 8px 8px !important;
    }

    #btn-visual,
    #btn-code {
        padding: 10px 14px !important;
        font-size: 14px !important;
    }

    #content-editor {
        min-height: 120px !important;
        font-size: 15px;
    }

    #content-code {
        min-height: 120px !important;
        font-size: 14px;
    }

    /* Mobile Checkbox Improvements */
    .lpk-checkbox-label {
        padding: 10px 12px;
        background: #f9fafb;
        border-radius: 8px;
        display: block;
        margin-bottom: 8px;
    }

    .lpk-form-hint {
        font-size: 12px;
        color: #666;
        display: block;
        margin-top: 5px;
    }

    /* Form inputs on mobile */
    .lpk-form input[type="text"],
    .lpk-form input[type="email"],
    .lpk-form input[type="date"],
    .lpk-form input[type="time"],
    .lpk-form select,
    .lpk-form textarea {
        width: 100%;
        padding: 12px 14px;
        font-size: 16px;
        border-radius: 8px;
        border: 1px solid #ddd;
    }

    .lpk-form-actions {
        margin-top: 20px;
    }

    .lpk-form-actions button {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }
}

/* Menu Icon Styles - Global */
.lpk-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lpk-sidebar-nav .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.lpk-sidebar-nav li.active .dashicons {
    opacity: 1;
}

/* Date Time Inputs */
.lpk-date-time-inputs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lpk-date-time-inputs input {
    flex: 1;
    min-width: 120px;
}

@media (max-width: 768px) {
    .lpk-date-time-inputs {
        flex-direction: column;
        gap: 8px;
    }

    .lpk-date-time-inputs input {
        width: 100%;
    }
}

/* Auth Containers */
.lpk-auth-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 20px;
}

.lpk-auth-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.lpk-auth-box-wide {
    max-width: 600px;
}

.lpk-auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.lpk-auth-header h1 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #333;
}

.lpk-auth-header p {
    margin: 0;
    color: #666;
}

.lpk-auth-form .lpk-form-group {
    margin-bottom: 20px;
}

.lpk-auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.lpk-auth-form input[type="text"],
.lpk-auth-form input[type="email"],
.lpk-auth-form input[type="password"],
.lpk-auth-form textarea,
.lpk-auth-form select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lpk-auth-form input:focus,
.lpk-auth-form textarea:focus,
.lpk-auth-form select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.lpk-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.lpk-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lpk-form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    display: block;
}

.lpk-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.lpk-checkbox-label input[type="checkbox"] {
    width: auto;
}

.lpk-auth-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
}

.lpk-auth-link:hover {
    text-decoration: underline;
}

.lpk-button-block {
    display: block;
    width: 100%;
    text-align: center;
}

.lpk-button-secondary {
    background: #f0f0f0;
    color: #333;
}

.lpk-button-secondary:hover {
    background: #e0e0e0;
}

.lpk-auth-footer {
    margin-top: 25px;
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.lpk-auth-footer p {
    margin: 0;
    color: #666;
}

.lpk-auth-footer a {
    color: #0073aa;
    text-decoration: none;
}

.lpk-notice-success {
    background: #e7fff2;
    border-left: 4px solid #00a32a;
}

/* Tables */
.lpk-table {
    width: 100%;
    border-collapse: collapse;
}

.lpk-table th,
.lpk-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.lpk-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.lpk-table tr:hover {
    background: #f8f9fa;
}

.lpk-empty-state {
    text-align: center;
    padding: 40px !important;
    color: #888;
}

.lpk-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lpk-user-info img {
    border-radius: 50%;
}

/* Badges */
.lpk-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    background: #e0e0e0;
    color: #333;
}

.lpk-badge-admin {
    background: #e7f4ff;
    color: #0073aa;
}

.lpk-badge-sensei {
    background: #fff3e0;
    color: #e65100;
}

.lpk-badge-siswa {
    background: #e8f5e9;
    color: #2e7d32;
}

.lpk-badge-staff {
    background: #f3e5f5;
    color: #7b1fa2;
}

.lpk-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.lpk-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.lpk-status-active::before {
    background: #00a32a;
}

.lpk-status-suspended::before {
    background: #dc3232;
}

/* Action Buttons */
.lpk-actions {
    display: flex;
    gap: 5px;
}

.lpk-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.lpk-btn-warning {
    background: #fff3e0;
    color: #e65100;
}

.lpk-btn-warning:hover {
    background: #ffe0b2;
}

.lpk-btn-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.lpk-btn-success:hover {
    background: #c8e6c9;
}

.lpk-btn-danger {
    background: #ffe7e7;
    color: #dc3232;
}

.lpk-btn-danger:hover {
    background: #ffcdd2;
}

/* Tabs */
.lpk-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 0;
}

.lpk-tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.lpk-tab-btn:hover {
    color: #0073aa;
}

.lpk-tab-btn.active {
    color: #0073aa;
    border-bottom-color: #0073aa;
}

/* Modal */
.lpk-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lpk-modal.active {
    display: flex;
}

.lpk-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.lpk-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.lpk-modal-header h3 {
    margin: 0;
}

.lpk-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    padding: 0;
    line-height: 1;
}

.lpk-modal-close:hover {
    color: #333;
}

.lpk-modal-body {
    padding: 20px;
}

.lpk-modal-tab-content {
    display: none;
}

.lpk-modal-tab-content.active {
    display: block;
}

.lpk-tabs-modal {
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.lpk-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Card Header Actions */
.lpk-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.lpk-card-actions {
    display: flex;
    gap: 10px;
}

.lpk-stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.lpk-stats-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 600px) {
    .lpk-form-row-2 {
        grid-template-columns: 1fr;
    }

    .lpk-stats-grid-3,
    .lpk-stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .lpk-auth-box {
        padding: 25px;
    }
}