@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;900&display=swap');

:root {
    --bg-dark: #0a0a0f;
    --bg-card: rgba(20, 20, 25, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    --primary-neon: #00f0ff;
    --primary-neon-dim: rgba(0, 240, 255, 0.2);
    --secondary-neon: #ff003c;
    --text-main: #f0f0f5;
    --text-muted: #8a8a9a;
    
    /* Status Colors */
    --status-recibido: #ffb800;
    --status-revision: #00f0ff;
    --status-repuesto: #ff003c;
    --status-reparado: #00ff66;
    --status-entregado: #8a8a9a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 240, 255, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(255, 0, 60, 0.04) 0%, transparent 50%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-header {
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff, var(--primary-neon));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    position: relative;
}

.logo-img {
    max-height: 45px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px var(--primary-neon-dim));
}

/* Inputs & Buttons */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s;
}

select, input, textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 1rem 1.2rem;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--primary-neon);
    box-shadow: 0 0 10px var(--primary-neon-dim);
}

select option {
    background: var(--bg-dark);
    color: var(--text-main);
}

.btn-primary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--primary-neon);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-neon);
    transition: all 0.4s ease;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary:hover {
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--primary-neon-dim);
}

/* Layouts */
.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 5%;
    flex: 1;
}

/* Client Portal Specific */
.tracking-wrapper {
    max-width: 600px;
    margin: 10vh auto;
    text-align: center;
}

.tracking-wrapper h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

#trackingInput {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 700;
}

/* Status Timeline View */
#resultContainer {
    display: none;
    margin-top: 3rem;
    animation: fadeIn 0.5s ease forwards;
}

.timeline {
    position: relative;
    max-width: 400px;
    margin: 2rem auto;
    text-align: left;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--border-glass);
}

.timeline-step {
    position: relative;
    padding-left: 50px;
    margin-bottom: 2rem;
    opacity: 0.5;
    transition: all 0.5s ease;
}

.timeline-step::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--border-glass);
    transition: all 0.5s ease;
    z-index: 2;
}

.timeline-step.active {
    opacity: 1;
}

.timeline-step.active::before {
    background: var(--primary-neon);
    border-color: var(--primary-neon);
    box-shadow: 0 0 15px var(--primary-neon);
}

.timeline-step.completed::before {
    background: var(--status-reparado);
    border-color: var(--status-reparado);
}

.timeline-step h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.timeline-step p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Admin Dashboard Specific */
.admin-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

.kanban-board {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 1rem;
}

.kanban-col {
    min-width: 280px;
    background: rgba(10, 10, 15, 0.4);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid var(--border-glass);
}

.kanban-header {
    font-size: 1.1rem;
    font-weight: 700;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
}

.badge {
    background: var(--border-glass);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1rem;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.order-card:active {
    cursor: grabbing;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.code-tag {
    color: var(--primary-neon);
    font-weight: 900;
    letter-spacing: 1px;
}

.device-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.fault-tag {
    color: var(--secondary-neon);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.customer-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseBorder {
    0% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 240, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}

/* Responsiveness */
@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* Pattern Lock Styles */
.pattern-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border-glass);
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}

#patternContainer {
    width: 200px;
    height: 200px;
    position: relative;
    background: radial-gradient(circle, rgba(0,240,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    user-select: none;
    touch-action: none; 
}

.pattern-dot {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 20;
}

.pattern-dot::after {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.2s;
    pointer-events: none;
}

.pattern-dot.active::after {
    background: var(--primary-neon);
    box-shadow: 0 0 15px var(--primary-neon);
    transform: scale(1.5);
}

.pattern-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
}

.pattern-line {
    stroke: var(--primary-neon);
    stroke-width: 4;
    stroke-linecap: round;
    opacity: 0.8;
}

.clear-pattern-btn {
    margin-top: 10px;
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.clear-pattern-btn:hover {
    background: rgba(255,0,60,0.1);
    color: var(--secondary-neon);
    border-color: var(--secondary-neon);
}
