:root {
    --bg-color: #0f1115;
    --card-bg: rgba(25, 28, 35, 0.7);
    --text-main: #f0f2f5;
    --text-muted: #9ba1a6;
    --accent: #5e6ad2;
    --accent-hover: #4b55b3;
    --success: #34d399;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Dashboard & Feed */
.dashboard-section {
    width: 100%;
}

.upload-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    position: sticky;
    top: 20px;
    z-index: 10;
}

.camera-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(94, 106, 210, 0.9), rgba(75, 85, 179, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.camera-btn:active {
    transform: scale(0.95);
}

.camera-btn svg {
    margin-right: 12px;
}

.camera-btn span {
    font-weight: 600;
    font-size: 16px;
}

.feed-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Card Loading State */
.loading-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}

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

.loading-card p {
    color: var(--text-muted);
    font-size: 15px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Results Cards */
.result-card {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.image-preview-container {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 20px;
    padding: 24px;
    position: relative;
}

.verdict-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.verdict-badge.buy {
    background-color: var(--success);
    color: #000;
}

.verdict-badge.pass {
    background-color: var(--danger);
    color: #fff;
}

.item-name {
    font-size: 20px;
    margin-bottom: 16px;
    padding-right: 60px;
    font-weight: 700;
}

.price-container {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.price-label {
    color: var(--text-muted);
    font-size: 13px;
}

.price-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--success);
}

.details-container h3 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.details-container p {
    font-size: 14px;
    color: var(--text-main);
}

/* Error Card */
.error-card {
    text-align: center;
    padding: 30px 20px;
}

.error-card h2 {
    color: var(--danger);
    margin-bottom: 8px;
    font-size: 18px;
}

.error-card p {
    color: var(--text-muted);
}

/* Login specific styles */
.text-input {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s;
}

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

.primary-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background-color: var(--accent);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

/* Draft UI */
.draft-container h3 {
    font-size: 16px;
    margin-bottom: 12px;
}
.draft-thumbnails {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.draft-thumb-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
.draft-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.draft-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}
.add-photo-btn {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px dashed rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}
.add-photo-btn:hover {
    border-color: var(--accent);
    color: var(--text-main);
}
.image-preview-container.multi {
    display: flex;
    gap: 8px;
    height: 150px;
}
.image-preview-container.multi img {
    flex: 1;
    width: 30%;
    border-radius: 8px;
}

/* Correction UI */
.correction-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.correction-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.correction-toggle-btn:hover {
    color: var(--text-main);
}

.correction-input-area {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.correction-input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-size: 14px;
    outline: none;
}

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

.correction-send-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.correction-send-btn:hover {
    background: var(--accent-hover);
}
.correction-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Landing Page Styles */
.hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--bg-card) 0%, #f8fafc 100%);
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.hero h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

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

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
