@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --backdrop-blur: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-btn.primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.nav-btn.secondary {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
}

.nav-btn.secondary:hover {
    color: white;
    border-color: rgba(255,255,255,0.3);
}

/* Auth Cards */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 2rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(var(--backdrop-blur));
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn {
    width: 100%;
    padding: 0.8rem;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.scan-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.scan-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.5);
}

.scan-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.scan-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.scan-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-main);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.5);
    cursor: pointer;
    transition: transform 0.3s;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
}

/* Scanner Interface */
.scanner-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    padding: 1rem;
    gap: 1rem;
}

.viewport {
    flex: 1;
    background: black;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.controls-overlay {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 2rem;
    align-items: center;
}

.capture-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid white;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.capture-btn:active {
    background: white;
    transform: scale(0.9);
}

.gallery-strip {
    height: 120px;
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 15px;
}

.thumbnail {
    height: 100%;
    aspect-ratio: 3/4;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail.selected {
    border-color: var(--primary);
}

.save-panel {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1rem 0;
}
