:root {
    --primary-color: #00f2fe;
    --secondary-color: #4facfe;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-light: #f8fafc;
    --gap: 20px;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

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

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

header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    letter-spacing: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-fill-color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}

.demo-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 4px;
    margin-top: 10px;
    letter-spacing: 1px;
}

.upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.drop-area {
    background: var(--card-bg);
    border: 2px dashed rgba(0, 242, 254, 0.4);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 600px;
}

.drop-area.highlight {
    border-color: var(--primary-color);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.2);
    transform: scale(1.02);
}

.upload-icon {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.button {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    color: #000;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
}

.samples-container {
    text-align: center;
    width: 100%;
    max-width: 600px;
}

.samples-container h3 {
    margin-bottom: 20px;
    color: #94a3b8;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.samples-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sample-item {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.05);
}

.sample-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.sample-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.sample-item span {
    font-size: 0.8rem;
    color: #94a3b8;
}

.result-section {
    max-width: 1000px;
    margin: 20px auto;
}

.hidden {
    display: none !important;
}

.loader-container {
    text-align: center;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.scanner-line {
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
    position: absolute;
    left: 0;
    animation: scan 2s linear infinite;
    z-index: 1;
}

@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.log-container {
    margin-top: 30px;
    font-family: monospace;
    color: var(--primary-color);
    text-align: left;
    height: 150px;
    overflow-y: hidden;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    font-size: 0.8rem;
}

.result-display {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    animation: fadeIn 0.5s ease;
}

.result-image-container {
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#result-img {
    max-width: 100%;
    max-height: 500px;
}

#detection-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.status-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}

.status-card.crack { border-left: 5px solid #ef4444; }
.status-card.no-crack { border-left: 5px solid #22c55e; }

footer {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .result-display { grid-template-columns: 1fr; }
}
