/*
Theme Name:       RUIYI Restaurant POS PWA
Theme URI:        https://ruiyipos.com
Description:      Progressive Web App version of RUIYI POS Manager with offline support and data synchronization.
Author:           RUIYI TECHNOLOGY
Author URI:       https://ruiyitechnology.es
Version:          2.0.0
Text Domain:      ruiyi-pos-pwa
License:          GNU General Public License v2 or later
License URI:      https://www.gnu.org/licenses/gpl-2.0.html
Requires at least: 5.9
Requires PHP:      7.4
*/

/* ==============================
   🖋️  1. ESTILOS GENERALES
================================= */
body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f8f8;
    color: #333;
    line-height: 1.6;
}

/* PWA specific styles */
body.pwa-installed {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff4444;
    color: white;
    text-align: center;
    padding: 10px;
    z-index: 9999;
    display: none;
}

.offline-indicator.show {
    display: block;
}

/* Sync status indicator */
.sync-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 9998;
    display: none;
}

.sync-status.show {
    display: block;
}

.sync-status.syncing {
    background: #ffa500;
}

.sync-status.success {
    background: #44ff44;
}

.sync-status.error {
    background: #ff4444;
}

/* 🔥 收银系统风格离线横幅 */
.pwa-connection-banner {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%) translateY(100px);
    z-index: 10000;
    width: min(380px, calc(100vw - 32px));
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.pwa-connection-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-connection-banner__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4), 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pwa-connection-banner__icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-connection-banner__icon svg {
    color: #fff;
}

.pwa-connection-banner__icon i {
    font-size: 18px;
    color: #fff;
}

.pwa-connection-banner__content {
    flex: 1;
    min-width: 0;
}

.pwa-connection-banner__title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pwa-connection-banner__desc {
    font-size: 11px;
    opacity: 0.95;
    line-height: 1.3;
    margin-top: 2px;
    font-weight: 400;
}

.pwa-connection-banner__status {
    display: flex;
    align-items: center;
    padding-left: 8px;
}

.pwa-connection-banner__dot {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: pwaPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

@keyframes pwaPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* ==============================
   🔗  2. ENLACES Y BOTONES
================================= */
a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

a:hover, a:focus {
    color: #005177;
    text-decoration: underline;
}

/* 仅对提交按钮应用默认样式，避免影响其他按钮 */
input[type="submit"],
button[type="submit"] {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease-in-out;
}

/* 特定按钮组的样式重置 - 仅针对需要透明背景的按钮 */
/* 注意：不再使用 !important 以允许 Tailwind 类正常工作 */
.billing-tab,
.tab-button,
.takeaway-tab-button {
    background-color: transparent;
}

.billing-tab:hover,
.billing-tab:focus,
.billing-tab:active,
.tab-button:hover,
.tab-button:focus,
.tab-button:active {
    background-color: transparent;
}

/* ==============================
   📌  3. ENCABEZADOS Y TEXTOS
================================= */
h1, h2, h3 {
    font-weight: bold;
}

h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

/* ==============================
   🛒  4. TABLA DE REPORTES DE VENTAS
================================= */
.ruiyi-sales-report {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 16px;
    text-align: left;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.ruiyi-sales-report th, 
.ruiyi-sales-report td {
    padding: 12px;
    border: 1px solid #ddd;
}

.ruiyi-sales-report th {
    background-color: #0073aa;
    color: white;
    text-transform: uppercase;
}

.ruiyi-sales-report tr:nth-child(even) {
    background-color: #f9f9f9;
}

.ruiyi-sales-report tr:hover {
    background-color: #f1f1f1;
}

/* ==============================
   📱  5. RESPONSIVE DESIGN
================================= */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .ruiyi-sales-report {
        font-size: 14px;
    }

    button, input[type="submit"] {
        font-size: 14px;
        padding: 8px 12px;
    }
}



