/* 
 * Administration Dashboard Styles
 * Lightweight, clean design with rounded corners
 */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
}

.nav-item {
    display: block;
    padding: 10px 20px 10px 32px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 0;
}

.nav-item:hover {
    background-color: #e9ecef;
    color: #212529;
}

.nav-item.active {
    background-color: #e7f1ff;
    color: #0d6efd;
    font-weight: 500;
}

/* Settings section at bottom */
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid #e9ecef;
    padding-top: 8px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 32px;
    background-color: #ffffff;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
}

.page-header p {
    color: #6c757d;
    font-size: 14px;
}

/* Cards */
.card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.form-control::placeholder {
    color: #adb5bd;
}

/* Search Bar */
.search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

.search-container .form-control {
    flex: 1;
    max-width: 400px;
}

.geo-select {
    width: 100px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary:hover {
    background-color: #0b5ed7;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5c636a;
}

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

.btn-danger:hover {
    background-color: #bb2d3b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
    background-color: #f8f9fa;
}

td {
    font-size: 14px;
    color: #495057;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

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

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: #f8f9fa;
}

.product-info {
    padding: 16px;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-price {
    font-size: 16px;
    font-weight: 600;
    color: #0d6efd;
}

.product-price .sale {
    color: #dc3545;
}

.product-price .original {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 13px;
    margin-left: 8px;
}

.product-meta {
    font-size: 12px;
    color: #6c757d;
    margin-top: 8px;
}

/* API Key Display */
.api-key-display {
    font-family: 'Monaco', 'Consolas', monospace;
    background-color: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-size: 13px;
    word-break: break-all;
}

.api-key-masked {
    color: #6c757d;
    letter-spacing: 2px;
}

.api-key-warning {
    background-color: #fff3cd;
    border: 1px solid #ffecb5;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #856404;
}

.api-key-success {
    background-color: #d1e7dd;
    border: 1px solid #badbcc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.api-key-success h4 {
    color: #0f5132;
    margin-bottom: 8px;
}

.api-key-success code {
    display: block;
    background-color: #fff;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    word-break: break-all;
    margin: 8px 0;
}

/* Error alert box for API key creation failures */
.api-key-error {
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    color: #842029;
}

.api-key-error h4 {
    color: #842029;
    margin-bottom: 8px;
    font-size: 16px;
}

.api-key-error p {
    color: #58151c;
    margin: 0;
    font-size: 14px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
}

.badge-active {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-inactive {
    background-color: #f8d7da;
    color: #842029;
}

.badge-pending {
    background-color: #fff3cd;
    color: #856404;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #495057;
}

.empty-state p {
    font-size: 14px;
}

/* WIP Banner */
.wip-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
}

.wip-banner h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.wip-banner p {
    opacity: 0.9;
    font-size: 14px;
}

/* Time Range Selector */
.time-range-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.time-range-btn {
    padding: 8px 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    color: #495057;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.time-range-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.time-range-btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* Auth Pages */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f8f9fa;
}

.auth-card {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 32px;
}

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

.auth-card .btn {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #6c757d;
}

.auth-footer a {
    color: #0d6efd;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Error Messages */
.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
    padding: 12px 16px;
    color: #842029;
    font-size: 14px;
    margin-bottom: 16px;
}

/* User Info in Sidebar */
.user-info {
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    font-size: 13px;
}

.user-info .user-email {
    color: #495057;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info .logout-link {
    color: #dc3545;
    text-decoration: none;
    font-size: 13px;
    margin-top: 8px;
    display: inline-block;
}

.user-info .logout-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-container .form-control {
        max-width: 100%;
    }
}
