/**
 * POS Home Page Styles
 * الصفحة الرئيسية
 */

/* ===== Home Wrap ===== */
.pos-home-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Headings Typography */
.pos-home-wrap h1,
.pos-home-wrap h2,
.pos-home-wrap h3,
.pos-home-wrap h4,
.pos-home-wrap h5,
.pos-home-wrap h6 {
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
}

/* ===== Header ===== */
.pos-home-wrap .pos-header {
    background: #fff;
    color: #1e293b;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.pos-home-wrap .pos-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pos-home-wrap .pos-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pos-home-wrap .pos-logo .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.pos-home-wrap .pos-logo h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.pos-home-wrap .pos-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pos-home-wrap .pos-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    min-height: 44px;
    color: #475569;
}

.pos-home-wrap .pos-user-info .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #64748b;
}

/* ===== PWA Install Button ===== */
.pos-pwa-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 14px;
    cursor: not-allowed;
    opacity: 0.75;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.2s;
    font-family: inherit;
}

.pos-pwa-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.pos-pwa-pill {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.pos-pwa-btn.ready {
    cursor: pointer;
    opacity: 1;
}

.pos-pwa-btn.ready:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
}

.pos-pwa-btn.installed {
    cursor: default;
    opacity: 0.9;
    background: #e0f2fe;
    color: #0f172a;
}

/* ===== Icon Button ===== */
.pos-home-wrap .pos-icon-btn {
    background: #f3f4f6;
    border: none;
    color: #64748b;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.pos-home-wrap .pos-icon-btn:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.pos-home-wrap .pos-icon-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #64748b;
}

/* ===== Main Content ===== */
.pos-home-main {
    flex: 1;
    padding: 60px 24px 40px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.pos-home-welcome {
    text-align: center;
    margin-bottom: 48px;
}

.pos-home-welcome h2 {
    font-size: 32px;
    color: #1e293b;
    margin-bottom: 12px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pos-home-welcome p {
    font-size: 18px;
    color: #64748b;
}

/* ===== Welcome Header ===== */
.pos-welcome-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 24px;
}

.pos-welcome-logo {
    max-width: 80px;
    height: auto;
    object-fit: contain;
}

/* ===== Section Cards Grid ===== */
.pos-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.pos-section-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    display: block;
}

.pos-section-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Card Variants */
.pos-section-card.cashier {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
}

.pos-section-card.products {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.pos-section-card.reports {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
}

.pos-section-card.customers {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

.pos-section-card.settings {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: white;
}

/* Card Icon */
.pos-section-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-section-icon .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
}

/* Card Text */
.pos-section-card h3 {
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 700;
}

.pos-section-card p {
    font-size: 15px;
    opacity: 0.9;
    line-height: 1.6;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1100px) {
    .pos-sections-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .pos-welcome-header {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .pos-home-main {
        padding: 50px 16px;
    }

    .pos-home-welcome h2 {
        font-size: 24px;
    }

    .pos-sections-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .pos-section-card {
        padding: 20px;
    }

    .pos-section-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 12px;
    }

    .pos-section-icon .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }

    .pos-section-card h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .pos-section-card p {
        font-size: 13px;
        display: none;
    }

    .pos-home-wrap .pos-logo h1 {
        display: none;
    }

    .pos-home-wrap .pos-header {
        padding: 0 12px;
        flex-wrap: nowrap;
        gap: 8px;
        height: 56px;
        overflow: hidden;
    }

    .pos-home-wrap .pos-header-right {
        flex: 1;
        min-width: 0;
        gap: 8px;
    }

    .pos-home-wrap .pos-logo .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }

    .pos-home-wrap .pos-header-left {
        gap: 6px;
    }

    .pos-home-wrap .pos-icon-btn {
        width: 36px;
        height: 36px;
    }

    .pos-home-wrap .pos-icon-btn .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }

    .pos-pwa-btn {
        padding: 6px 10px;
        font-size: 12px;
        gap: 6px;
        min-height: 36px;
        border-radius: 8px;
    }

    .pos-pwa-btn .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }

    .pos-pwa-text {
        flex: 1;
        text-align: right;
    }

    .pos-pwa-pill {
        font-size: 9px;
        padding: 2px 5px;
    }

    .pos-home-wrap .pos-user-info {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 36px;
        border-radius: 6px;
    }

    .pos-home-wrap .pos-user-info .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }

    .pos-welcome-header {
        gap: 10px;
    }

    .pos-welcome-logo {
        max-width: 60px;
    }
}

/* Force Portrait on Mobile (Block Landscape) */
@media screen and (max-width: 950px) and (orientation: landscape) and (max-height: 600px) {
    .pos-home-wrap {
        display: none !important;
    }

    body::after {
        content: "يرجى تدوير الجهاز للوضع العمودي";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #1f2937;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: inherit;
        font-size: 18px;
        font-weight: bold;
        z-index: 99999;
        text-align: center;
        white-space: pre-wrap;
    }
}