/* ==========================================
   Admin Panel CSS
   ========================================== */

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f9f9f9;
}

.login-container {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    font-weight: 700;
    font-size: 18px;
}

.login-logo img {
    height: 30px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 25px;
    font-family: 'Inter', sans-serif;
    color: #111;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.login-form input:focus {
    border-color: #ff9900;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background-color: #ff9900;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-login:hover {
    background-color: #e68a00;
}

.login-error {
    background: #ffeeee;
    color: #cc0000;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

/* ==========================================
   Dashboard Layout 
   ========================================== */

.admin-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: #ffffff;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px 0;
    background: #fff;
    flex-shrink: 0;
}

.sidebar-top {
    padding: 0 30px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 50px;
    font-weight: 700;
    font-size: 16px;
    color: #111;
}

.sidebar-logo .logo-img {
    height: 24px;
}

.menu-label {
    font-size: 12px;
    color: #999;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links {
    list-style: none;
    padding: 0;
}

.nav-links li {
    margin-bottom: 10px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #888;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 0;
    transition: color 0.2s;
}

.nav-links a.active {
    color: #ff9900;
}

.nav-links a:hover {
    color: #333;
}

.nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.5;
}

.nav-links a.active .nav-icon {
    opacity: 1;
    filter: invert(62%) sepia(85%) saturate(2250%) hue-rotate(1deg) brightness(105%) contrast(106%); /* Approximation for orange */
}

.sidebar-bottom {
    padding: 0 30px;
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #ff4d4d;
    font-weight: 600;
    font-size: 14px;
}

.logout-link .nav-icon {
    opacity: 1;
    filter: invert(44%) sepia(91%) saturate(3015%) hue-rotate(338deg) brightness(100%) contrast(106%); /* Red */
}

/* Main Content */
.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.admin-header {
    min-height: 70px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 40px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-selector {
    display: flex;
    align-items: center;
    min-height: 44px;
    gap: 8px;
    background: #f5f5f5;
    padding: 8px 15px;
    border-radius: 200px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.lang-selector .flag-icon {
    width: 16px;
}

.lang-selector .arrow-down {
    font-size: 10px;
    color: #666;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f5f5f5;
    padding: 6px 6px 6px 15px;
    border-radius: 30px;
}

.profile-name {
    font-size: 12px;
    font-weight: 600;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    background: #ffdb99;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar img {
    width: 16px;
    height: 16px;
    filter: invert(53%) sepia(85%) saturate(2250%) hue-rotate(1deg) brightness(105%) contrast(106%);
}

/* Dashboard Content */
.dashboard-content {
    padding: 30px 60px;
}

.welcome-section {
    margin-bottom: 40px;
}

.welcome-section h1 {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

.welcome-section .orange-text {
    color: #ff9900;
}

.welcome-section .subtitle {
    color: #666;
    font-size: 15px;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 50px;
}

.kpi-card {
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 25px;
    background: #fff;
}

.kpi-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon img {
    width: 16px;
    height: 16px;
}

.icon-orange {
    background: #fff2e0;
}
.icon-orange img {
    filter: invert(62%) sepia(85%) saturate(2250%) hue-rotate(1deg) brightness(105%) contrast(106%);
}

.icon-blue {
    background: #e0f3ff;
}
.icon-blue img {
    filter: invert(75%) sepia(60%) saturate(1000%) hue-rotate(10deg) brightness(100%) contrast(100%);
}

.icon-green {
    background: #e6faeb;
}
.icon-green img {
    filter: invert(60%) sepia(85%) saturate(400%) hue-rotate(90deg) brightness(95%) contrast(90%);
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #111;
}

/* Bottom Grid */
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.dashboard-bottom-grid h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #111;
}

/* Best Sellers */
.best-sellers-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.seller-item {
    display: flex;
    align-items: center;
    background: #fff;
}

.seller-img {
    width: 60px;
    height: 50px;
    background: #f0f0f0;
    border-radius: 8px;
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.seller-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.seller-info {
    flex-grow: 1;
}

.seller-name {
    font-size: 13px;
    font-weight: 600;
    color: #111;
}

.seller-price {
    margin-right: 30px;
}

.price-badge {
    background: #e5e5e5;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.seller-qty {
    font-size: 14px;
    color: #111;
    min-width: 60px;
    text-align: right;
}

.text-xs {
    font-size: 10px;
    color: #666;
    font-weight: 500;
}

.empty-state {
    padding: 40px 0;
    text-align: center;
    color: #888;
    background: #f9f9f9;
    border-radius: 12px;
    font-size: 14px;
}

/* Chart */
.chart-container {
    height: 250px;
    width: 100%;
}

/* ==========================================
   Products List Page
   ========================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin-bottom: 5px;
}

.btn-primary {
    background: #ff9900;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background: #e68a00;
}

.filter-card, .table-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.filter-form {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.filter-group input, .filter-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    outline: none;
}
.filter-group input:focus, .filter-group select:focus {
    border-color: #ff9900;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.btn-outline {
    background: transparent;
    color: #555;
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.per-page-selector select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-left: 5px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 13px;
    font-weight: 600;
    color: #888;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

.table-img {
    width: 50px;
    height: 50px;
    background: #f9f9f9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.table-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.table-img .placeholder-icon {
    color: #ccc;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.status-badge.active { background: #e6faeb; color: #1cc051; }
.status-badge.inactive { background: #ffeeee; color: #cc0000; }

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-edit, .btn-delete {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.btn-edit { background: #f0f0f0; color: #333; }
.btn-delete { background: #ffeeee; color: #cc0000; }

.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 25px;
}

.page-link {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.page-link.active {
    background: #ff9900;
    color: #fff;
    border-color: #ff9900;
}
.page-link:hover:not(.active) {
    background: #f5f5f5;
}

/* Restrict textarea resizing to prevent UI breakage */
textarea {
    resize: vertical !important;
    max-height: 300px !important;
}

/* Sidebar Notification Badge & Table Row Pings */
.nav-badge {
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 18px;
    height: 18px;
    box-sizing: border-box;
}

.nav-badge::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 10px;
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    animation: nav-ping 1.5s infinite ease-in-out;
}

@keyframes nav-ping {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(255, 59, 48, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

.row-ping-dot {
    width: 10px;
    height: 10px;
    background-color: #ff3b30;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    vertical-align: middle;
}

.row-ping-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    animation: dot-ping 1.5s infinite ease-in-out;
}

@keyframes dot-ping {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(255, 59, 48, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

.row-new {
    animation: slide-down 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-down {
    0% {
        opacity: 0;
        transform: translateY(-20px);
        background-color: rgba(255, 153, 0, 0.15);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        background-color: transparent;
    }
}
