:root {
    --bg-dark: #0d1117;
    --panel-bg: rgba(22, 27, 34, 0.7);
    --border-color: rgba(48, 54, 61, 0.5);
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    
    --accent-blue: #1f6feb;
    --accent-blue-hover: #388bfd;
    --status-instock: #238636;
    --status-out: #da3633;
    --status-pending: #d29922;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.view {
    display: none;
    flex: 1;
}

.view.active {
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

/* Buttons */
.btn {
    font-family: inherit;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.primary-btn {
    background: var(--accent-blue);
    color: white;
}

.primary-btn:hover {
    background: var(--accent-blue-hover);
}

.outline-btn {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
}

.text-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.text-btn:hover {
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* Auth View */
#auth-view {
    justify-content: center;
    padding: 20px;
}

.auth-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.logo-pulse {
    width: 20px;
    height: 20px;
    background: var(--accent-blue);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(31, 111, 235, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(31, 111, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31, 111, 235, 0); }
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

input {
    background: rgba(1, 4, 9, 0.8);
    border: 1px solid var(--border-color);
    color: white;
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--accent-blue);
}

.turnstile-mock {
    background: rgba(35, 134, 54, 0.1);
    border: 1px solid rgba(35, 134, 54, 0.4);
    color: #46a758;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.auth-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Header & Tabs */
.glass-header {
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.tabs {
    display: flex;
    border-top: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 14px 0;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
}

.tab-btn.active {
    color: var(--text-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 3px 3px 0 0;
}

.badge {
    background: var(--status-out);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* Content Area */
.content-area {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Add Product */
.add-product-card {
    margin-bottom: 20px;
}

.add-product-card h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

#add-product-form {
    display: flex;
    gap: 10px;
}

#product-url {
    flex: 1;
    margin-bottom: 0;
}

.quota-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 12px;
    text-align: right;
}

/* Product Cards */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.product-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.product-domain {
    font-size: 0.8rem;
    color: var(--accent-blue);
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-in_stock {
    background: rgba(35, 134, 54, 0.2);
    color: #46a758;
    border: 1px solid rgba(35, 134, 54, 0.4);
}

.status-out_of_stock {
    background: rgba(218, 54, 51, 0.2);
    color: #ff7b72;
    border: 1px solid rgba(218, 54, 51, 0.4);
}

.status-pending {
    background: rgba(210, 153, 34, 0.2);
    color: #e3b341;
    border: 1px solid rgba(210, 153, 34, 0.4);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--status-out);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.delete-btn:hover { background: rgba(218,54,51,0.1); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

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

/* Inbox */
.inbox-container {
    display: flex;
    flex-direction: column;
    height: 60vh;
    padding: 0;
    overflow: hidden;
}

.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.message.system {
    background: rgba(210, 153, 34, 0.1);
    border: 1px solid rgba(210, 153, 34, 0.3);
    color: #e3b341;
    align-self: center;
    max-width: 95%;
}

.message.admin {
    background: rgba(31, 111, 235, 0.15);
    border: 1px solid rgba(31, 111, 235, 0.3);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.user {
    background: rgba(48, 54, 61, 0.6);
    border: 1px solid var(--border-color);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message .time {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: right;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(1, 4, 9, 0.4);
}

#chat-input {
    flex: 1;
    margin-bottom: 0;
}
