/**
 * TEKIO - Custom Styles
 * Built on Bootstrap 5
 */

:root {
    --tekio-primary: #22c55e;
    --tekio-primary-dark: #16a34a;
    --tekio-primary-light: #dcfce7;
    --tekio-secondary: #64748b;
    --tekio-success: #10b981;
    --tekio-danger: #ef4444;
    --tekio-warning: #f59e0b;
    --tekio-dark: #1a1a2e;
    --tekio-light: #f8fafc;
    --tekio-border: #e2e8f0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--tekio-light);
    color: var(--tekio-dark);
}

/* Override Bootstrap primary */
.btn-primary {
    background-color: var(--tekio-primary) !important;
    border-color: var(--tekio-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--tekio-primary-dark) !important;
    border-color: var(--tekio-primary-dark) !important;
}

.btn-outline-primary {
    color: var(--tekio-primary) !important;
    border-color: var(--tekio-primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--tekio-primary) !important;
    color: white !important;
}

.text-primary {
    color: var(--tekio-primary) !important;
}

.bg-primary {
    background-color: var(--tekio-primary) !important;
}

/* Override Bootstrap success (green) to TEKIO green */
.btn-success {
    background-color: var(--tekio-primary) !important;
    border-color: var(--tekio-primary) !important;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background-color: var(--tekio-primary-dark) !important;
    border-color: var(--tekio-primary-dark) !important;
}

.btn-outline-success {
    color: var(--tekio-primary) !important;
    border-color: var(--tekio-primary) !important;
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active,
.btn-check:checked + .btn-outline-success {
    background-color: var(--tekio-primary) !important;
    border-color: var(--tekio-primary) !important;
    color: white !important;
}

.text-success {
    color: var(--tekio-primary) !important;
}

.bg-success {
    background-color: var(--tekio-primary) !important;
}

.border-success {
    border-color: var(--tekio-primary) !important;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: var(--tekio-primary);
    color: var(--tekio-primary-dark);
}

.badge.bg-success {
    background-color: var(--tekio-primary) !important;
}

a {
    color: var(--tekio-primary);
}

a:hover {
    color: var(--tekio-primary-dark);
}

/* Navbar */
.navbar-tekio {
    background: linear-gradient(135deg, var(--tekio-primary) 0%, var(--tekio-primary-dark) 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Buttons */
.btn-tekio {
    background: var(--tekio-primary);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-tekio:hover {
    background: var(--tekio-primary-dark);
    transform: translateY(-1px);
}

/* Forms */
.form-control:focus {
    border-color: var(--tekio-primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.input-group-text {
    background-color: var(--tekio-light);
    border-color: var(--tekio-border);
}

/* Tables */
.table-tekio {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.table-tekio thead {
    background: var(--tekio-dark);
    color: white;
}

/* POS Specific */
.pos-container {
    height: calc(100vh - 60px);
}

.pos-products {
    height: 100%;
    overflow-y: auto;
}

.pos-cart {
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.product-card:hover {
    transform: scale(1.02);
}

.cart-item {
    padding: 12px;
    border-bottom: 1px solid var(--tekio-border);
}

.cart-total {
    background: var(--tekio-dark);
    color: white;
    padding: 20px;
    margin-top: auto;
}

/* Stat Icons - Perfect circles */
.stat-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 1.4rem;
}

.stat-icon-primary {
    background: rgba(34, 197, 94, 0.15);
    color: var(--tekio-primary);
}

.stat-icon-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--tekio-success);
}

.stat-icon-info {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.stat-icon-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--tekio-warning);
}

.stat-icon-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--tekio-danger);
}

/* Dashboard stat cards */
.card .stat-icon + div {
    overflow: hidden;
    min-width: 0;
    flex: 1;
}

.card .stat-icon + div h3 {
    font-size: clamp(0.85rem, 2.5vw, 1.25rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Clickable cards */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Status badges */
.badge-active {
    background: var(--tekio-success);
}

.badge-inactive {
    background: var(--tekio-secondary);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    background: #1a1a2e;
}

.login-container.centered {
    align-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.login-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--tekio-dark);
    text-align: center;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.login-logo svg {
    width: 40px;
    height: 40px;
    stroke: var(--tekio-primary);
}

.login-logo span {
    background: linear-gradient(135deg, var(--tekio-primary), var(--tekio-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--tekio-dark);
    height: 100vh;
    position: fixed;
    left: 0;
    overflow: hidden;
    top: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-brand svg {
    width: 28px;
    height: 28px;
    stroke: #22c55e;
    color: #22c55e;
}

.sidebar-brand h4 {
    color: white;
    margin: 0;
    font-weight: 700;
}

.sidebar-brand h4 .brand-tekio {
    color: #22c55e;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.sidebar-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: var(--tekio-primary);
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-section {
    padding: 20px 20px 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
}

.main-content {
    margin-left: 260px;
    padding: 24px;
    min-height: 100vh;
    background: var(--tekio-light);
}

/* User dropdown in sidebar */
.sidebar-user {
    flex-shrink: 0;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.sidebar-user-info a:hover .sidebar-user-avatar {
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.sidebar-user-info a:hover .text-white {
    color: var(--tekio-primary-light) !important;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: var(--tekio-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    margin-right: 12px;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* Focus states for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--tekio-light);
}

::-webkit-scrollbar-thumb {
    background: var(--tekio-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tekio-dark);
}

/* Product image gallery */
.delete-image-btn {
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.delete-image-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

#imageGallery > div {
    transition: opacity 0.3s, transform 0.3s;
}

/* Pagination styles */
.pagination {
    gap: 4px;
}

.pagination .page-link {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    color: #1a1a2e !important;
    background-color: white !important;
    padding: 8px 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background-color: #22c55e !important;
    border-color: #22c55e !important;
    color: white !important;
}

.pagination .page-item.active .page-link,
.pagination .page-item.active .page-link:hover,
.pagination .page-item.active .page-link:focus {
    background-color: #22c55e !important;
    border-color: #22c55e !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4) !important;
}

.pagination .page-item.disabled .page-link {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
}

.pagination .page-link i {
    font-size: 0.85rem;
}

