/* ============= Kapadokya Studio POS - Main CSS ============= */

/* CSS Variables */
:root {
    --primary: #E8570A;
    --primary-light: #F08B43;
    --primary-dark: #C44A08;
    --bg: #0f0e0c;
    --bg-card: #1a1916;
    --bg-hover: #252319;
    --text: #f5f0ea;
    --text-muted: #9ca3af;
    --border: #2a2520;
    --shadow: rgba(0, 0, 0, 0.3);
    --radius: 12px;
}

[data-theme="light"] {
    --bg: #f8f6f3;
    --bg-card: #ffffff;
    --bg-hover: #f3f0ec;
    --text: #1a1814;
    --text-muted: #6b7280;
    --border: #e5e0d8;
    --shadow: rgba(0, 0, 0, 0.08);
}

/* ===== LIGHT THEME OVERRIDES ===== */
/* Body: override hardcoded dark classes */
[data-theme="light"] body {
    background-color: var(--bg) !important;
    color: var(--text) !important;
}

/* Dark backgrounds → light equivalents */
[data-theme="light"] .bg-dark-900 { background-color: var(--bg) !important; }
[data-theme="light"] .bg-dark-800 { background-color: var(--bg-card) !important; }
[data-theme="light"] .bg-dark-700 { background-color: var(--bg-hover) !important; }
[data-theme="light"] .bg-dark-600 { background-color: #e8e4de !important; }
[data-theme="light"] .bg-dark-500 { background-color: #ddd8d0 !important; }
[data-theme="light"] .bg-dark-700\/50 { background-color: rgba(243,240,236,0.5) !important; }
[data-theme="light"] .bg-dark-800\/50 { background-color: rgba(255,255,255,0.5) !important; }
[data-theme="light"] .bg-dark-800\/80 { background-color: rgba(255,255,255,0.8) !important; }
[data-theme="light"] .bg-dark-800\/95 { background-color: rgba(255,255,255,0.95) !important; }
[data-theme="light"] .bg-dark-900\/50 { background-color: rgba(248,246,243,0.5) !important; }

/* Hover backgrounds */
[data-theme="light"] .hover\:bg-dark-700:hover { background-color: var(--bg-hover) !important; }
[data-theme="light"] .hover\:bg-dark-600:hover { background-color: #e8e4de !important; }
[data-theme="light"] .hover\:bg-white\/5:hover { background-color: rgba(0,0,0,0.04) !important; }
[data-theme="light"] .hover\:bg-white\/10:hover { background-color: rgba(0,0,0,0.06) !important; }

/* Text colors: gray/white → dark text */
[data-theme="light"] .text-gray-100,
[data-theme="light"] .text-gray-200 { color: var(--text) !important; }
[data-theme="light"] .text-gray-300 { color: #374151 !important; }
[data-theme="light"] .text-gray-400 { color: var(--text-muted) !important; }
[data-theme="light"] .text-gray-500 { color: #9ca3af !important; }
[data-theme="light"] .text-white { color: var(--text) !important; }

/* Preserve white text on colored/primary backgrounds */
[data-theme="light"] .bg-primary .text-white,
[data-theme="light"] .bg-primary-600 .text-white,
[data-theme="light"] .bg-primary-700 .text-white,
[data-theme="light"] .bg-primary.text-white,
[data-theme="light"] .bg-primary-600.text-white,
[data-theme="light"] .bg-primary-700.text-white,
[data-theme="light"] [class*="bg-red-5"].text-white,
[data-theme="light"] [class*="bg-green-5"].text-white,
[data-theme="light"] [class*="bg-blue-5"].text-white,
[data-theme="light"] [class*="bg-amber-5"].text-white,
[data-theme="light"] [class*="bg-red-5"] .text-white,
[data-theme="light"] [class*="bg-green-5"] .text-white,
[data-theme="light"] [class*="bg-blue-5"] .text-white,
[data-theme="light"] [class*="bg-amber-5"] .text-white,
[data-theme="light"] .btn-primary .text-white,
[data-theme="light"] .btn-primary.text-white,
[data-theme="light"] .btn.bg-primary.text-white,
[data-theme="light"] button[class*="bg-primary"],
[data-theme="light"] a[class*="bg-primary"] { color: #fff !important; }

/* Hover text */
[data-theme="light"] .hover\:text-white:hover { color: var(--primary) !important; }
[data-theme="light"] .group:hover .group-hover\:text-white { color: var(--text) !important; }
[data-theme="light"] .group:hover .group-hover\:text-gray-300 { color: #374151 !important; }

/* Border overrides */
[data-theme="light"] .border-dark-700,
[data-theme="light"] .border-dark-600,
[data-theme="light"] .border-dark-800 { border-color: var(--border) !important; }
[data-theme="light"] .border-white\/5,
[data-theme="light"] .border-white\/10,
[data-theme="light"] .border-white\/20 { border-color: var(--border) !important; }

/* Divide */
[data-theme="light"] .divide-dark-700 > :not([hidden]) ~ :not([hidden]),
[data-theme="light"] .divide-dark-800 > :not([hidden]) ~ :not([hidden]) { border-color: var(--border) !important; }

/* Translucent backgrounds */
[data-theme="light"] .bg-white\/5 { background-color: rgba(0,0,0,0.03) !important; }
[data-theme="light"] .bg-white\/10 { background-color: rgba(0,0,0,0.06) !important; }
[data-theme="light"] .bg-black\/50 { background-color: rgba(0,0,0,0.3) !important; }

/* Ring/outline */
[data-theme="light"] .ring-white\/5,
[data-theme="light"] .ring-white\/10 { --tw-ring-color: var(--border) !important; }

/* Scrollbar */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15) !important; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--primary) !important; }

/* Placeholder */
[data-theme="light"] ::placeholder { color: #9ca3af !important; }

/* Input fields */
[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
[data-theme="light"] select,
[data-theme="light"] textarea {
    background-color: var(--bg) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Table */
[data-theme="light"] thead th { background-color: var(--bg-hover) !important; color: var(--text) !important; }
[data-theme="light"] tbody tr:hover { background-color: var(--bg-hover) !important; }
[data-theme="light"] td { border-color: var(--border) !important; }

/* Sidebar */
[data-theme="light"] .sidebar-item.active,
[data-theme="light"] .sidebar-item[class*="bg-dark"] { background-color: var(--bg-hover) !important; }
[data-theme="light"] .sidebar-group-label { color: var(--text-muted) !important; }
/* ===== END LIGHT THEME OVERRIDES ===== */

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    outline: none;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.375rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    gap: 0.25rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background: #E8570A;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 87, 10, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #252319;
    color: #d1d5db;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover:not(:disabled) {
    background: #302d22;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-success {
    background: #16a34a;
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #15803d;
}

.btn-ghost {
    background: transparent;
    color: #9ca3af;
}

.btn-ghost:hover:not(:disabled) {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    padding: 0.5rem;
    min-width: 2.25rem;
    height: 2.25rem;
}

/* === Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.badge-green {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-orange {
    background: rgba(232, 87, 10, 0.1);
    color: #E8570A;
    border: 1px solid rgba(232, 87, 10, 0.2);
}

.badge-purple {
    background: rgba(168, 85, 247, 0.1);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.badge-red {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-gray {
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-yellow {
    background: rgba(234, 179, 8, 0.1);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.badge-amber {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-emerald {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* === Spinner === */
.spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(232, 87, 10, 0.2);
    border-top-color: #E8570A;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-sm {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 2px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Empty State === */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
    text-align: center;
    color: #6b7280;
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    max-width: 24rem;
}

/* === Tables === */
.admin-table th {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.admin-table td {
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: background 0.15s;
}

.admin-table tbody tr:hover {
    background: rgba(232, 87, 10, 0.03);
}

/* === Inputs === */
.input {
    width: 100%;
    padding: 0.625rem 1rem;
    background: #252319;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: #fff;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input::placeholder {
    color: #6b7280;
}

.input:focus {
    border-color: #E8570A;
    box-shadow: 0 0 0 3px rgba(232, 87, 10, 0.1);
}

.input-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

textarea.input {
    min-height: 5rem;
    resize: vertical;
}

/* === Card === */
.card {
    background: #1a1916;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
    border-color: rgba(232, 87, 10, 0.15);
}

.card-hover:hover {
    transform: translateY(-2px);
}

/* === Sidebar === */
.sidebar-group-title {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6b7280;
    padding: 1.25rem 1rem 0.375rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin: 0 0.5rem 1px;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #9ca3af;
    transition: all 0.15s;
    text-decoration: none;
    position: relative;
}

.sidebar-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active {
    color: #E8570A;
    background: rgba(232, 87, 10, 0.08);
    font-weight: 500;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 0.375rem;
    bottom: 0.375rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #E8570A;
}

.sidebar-item.active svg {
    color: #E8570A;
}

/* === Dropdown === */
.dropdown-menu {
    position: absolute;
    right: 0;
    margin-top: 0.5rem;
    width: 12rem;
    background: #252319;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 50;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: #9ca3af;
    transition: all 0.15s;
    text-decoration: none;
}

.dropdown-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* === Toggle Switch === */
.toggle-switch {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    background: #3b372b;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.active {
    background: #E8570A;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(1.5rem - 4px);
    height: calc(1.5rem - 4px);
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.active::after {
    transform: translateX(1.25rem);
}

/* === Toast === */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 24rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: all 0.3s;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.toast.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.toast.info {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.toast.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination a,
.pagination span {
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
    transition: all 0.15s;
    text-decoration: none;
}

.pagination a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.pagination .active {
    background: #E8570A;
    color: #fff;
}

/* === Auth Page === */
.auth-gradient {
    background: linear-gradient(135deg, #0a0907 0%, #1a1208 40%, #2a1a0a 100%);
}

.auth-card {
    backdrop-filter: blur(20px);
    background: rgba(26, 25, 22, 0.85);
}

.input-auth {
    transition: all 0.2s ease;
}

.input-auth:focus {
    border-color: #E8570A;
    box-shadow: 0 0 0 3px rgba(232, 87, 10, 0.1);
    outline: none;
}

.btn-primary-auth {
    transition: all 0.2s ease;
}

.btn-primary-auth:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(232, 87, 10, 0.3);
}

.btn-primary-auth:active {
    transform: translateY(0);
}

/* === Animations === */
@keyframes balloonFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }
}

.balloon-float {
    animation: balloonFloat 6s ease-in-out infinite;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-fade-in {
    animation: pageFadeIn 0.25s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-value {
    animation: countUp 0.4s ease-out forwards;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(232, 87, 10, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(232, 87, 10, 0);
    }
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

.glow-orange {
    box-shadow: 0 0 20px rgba(232, 87, 10, 0.15);
}

/* === Line Clamp === */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Stat Card === */
.stat-card {
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(232, 87, 10, 0.2);
}

/* === Tab Component === */
.tab-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #9ca3af;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.tab-item:hover {
    color: #fff;
}

.tab-item.active {
    color: #E8570A;
    border-bottom-color: #E8570A;
}

/* === Print === */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}
/* ===== LIGHT THEME — Components ===== */
/* btn-secondary */
[data-theme="light"] .btn-secondary {
    background-color: rgba(0, 0, 0, 0.04) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}
[data-theme="light"] .btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

/* Card component */
[data-theme="light"] .card {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}

/* Status badges & soft backgrounds */
[data-theme="light"] .bg-green-500\/10,
[data-theme="light"] .bg-green-500\/20 { background-color: rgba(34,197,94,0.1) !important; }
[data-theme="light"] .bg-red-500\/10,
[data-theme="light"] .bg-red-500\/20 { background-color: rgba(239,68,68,0.1) !important; }
[data-theme="light"] .bg-blue-500\/10,
[data-theme="light"] .bg-blue-500\/20 { background-color: rgba(59,130,246,0.1) !important; }
[data-theme="light"] .bg-yellow-500\/10,
[data-theme="light"] .bg-yellow-500\/20 { background-color: rgba(234,179,8,0.1) !important; }
[data-theme="light"] .bg-orange-500\/10,
[data-theme="light"] .bg-orange-500\/20 { background-color: rgba(249,115,22,0.1) !important; }
[data-theme="light"] .bg-amber-500\/10,
[data-theme="light"] .bg-amber-500\/20 { background-color: rgba(245,158,11,0.1) !important; }
[data-theme="light"] .bg-purple-500\/10 { background-color: rgba(168,85,247,0.1) !important; }
[data-theme="light"] .bg-primary\/10,
[data-theme="light"] .bg-primary\/20 { background-color: rgba(232,87,10,0.1) !important; }

/* Modal backdrop - keep dark */
[data-theme="light"] .bg-black\/50 { background-color: rgba(0,0,0,0.4) !important; }

/* Dropdown/popover */
[data-theme="light"] .shadow-xl,
[data-theme="light"] .shadow-2xl {
    box-shadow: 0 10px 40px rgba(0,0,0,0.12) !important;
}

/* Notification badge - keep primary */
[data-theme="light"] .notification-pulse { background-color: #E8570A !important; color: #fff !important; }

/* Sidebar active item */
[data-theme="light"] .sidebar-item.active {
    background-color: rgba(232,87,10,0.08) !important;
}

/* Focus ring */
[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
    box-shadow: 0 0 0 2px rgba(232,87,10,0.15) !important;
}
/* ===== END LIGHT THEME Components ===== */
