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

:root {
    --bg-dark: #050b14;
    --card-bg: rgba(10, 25, 47, 0.7);
    --primary-neon: #00f3ff;
    --primary-glow: 0 0 15px rgba(0, 243, 255, 0.5), 0 0 30px rgba(0, 243, 255, 0.3);
    --secondary-neon: #7000ff;
    --text-main: #e6f1ff;
    --text-muted: #8892b0;
    --danger-color: #ff0055;
    --danger-glow: 0 0 15px rgba(255, 0, 85, 0.5);
    --border-color: rgba(0, 243, 255, 0.15);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    background-color: var(--bg-dark);
    /* High-tech grid background */
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    font-family: 'Rajdhani', sans-serif;
    position: relative;
    overflow-x: hidden;
}

/* Ambient background glow */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(112, 0, 255, 0.15) 0%, transparent 60%);
    z-index: -1;
    border-radius: 50%;
}

body::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.1) 0%, transparent 60%);
    z-index: -1;
    border-radius: 50%;
}

.app-container {
    width: 100%;
    max-width: 1600px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100vh;
}

/* HUD Glassmorphism Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Tech corner accents */
.card::before, .card::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border: 2px solid var(--primary-neon);
    opacity: 0.5;
}
.card::before { top: 0; left: 0; border-right: none; border-bottom: none; border-top-left-radius: var(--radius); }
.card::after { bottom: 0; right: 0; border-left: none; border-top: none; border-bottom-right-radius: var(--radius); }

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, rgba(10, 25, 47, 0.9) 0%, rgba(11, 35, 65, 0.8) 100%);
    padding: 20px 30px;
    border-left: 4px solid var(--primary-neon);
    border-radius: var(--radius);
}

.header-content h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.header-content h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-neon);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-icon {
    color: var(--primary-neon);
    filter: drop-shadow(0 0 8px var(--primary-neon));
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 5px var(--primary-neon)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 15px var(--primary-neon)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 5px var(--primary-neon)); }
}

/* Main Layout */
.dashboard-main {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

/* Main Panel (Left) */
.main-panel {
    flex: 3.5;
    display: flex;
    flex-direction: column;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    height: 100%;
}

.image-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: rgba(2, 12, 27, 0.6);
}

.image-box:hover {
    border-color: var(--primary-neon);
    box-shadow: inset 0 0 20px rgba(0, 243, 255, 0.1);
}

.image-box h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: var(--transition);
}

.image-box:hover h3 {
    color: var(--primary-neon);
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.5);
}

.image-preview {
    flex: 1;
    background: #020c1b;
    border: 1px dashed rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    min-height: 140px;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.1));
}

.placeholder {
    color: var(--text-muted);
    font-size: 14px;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    opacity: 0.6;
}

/* Loader Animation */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid transparent;
    border-top-color: var(--primary-neon);
    border-bottom-color: var(--secondary-neon);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    position: absolute;
}

.loader::before {
    content: '';
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 3px solid transparent;
    border-left-color: var(--primary-neon);
    border-radius: 50%;
    animation: spin 1s linear infinite reverse;
}

/* Side Menu (Right) */
.side-menu {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
}

.menu-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: var(--primary-neon);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    background: rgba(10, 25, 47, 0.5);
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn:hover:not(:disabled) {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--primary-neon);
    color: var(--primary-neon);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-primary {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--primary-neon);
    color: var(--primary-neon);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-neon);
    color: var(--bg-dark);
    box-shadow: var(--primary-glow);
}

.btn-action {
    background: rgba(112, 0, 255, 0.15);
    border-color: var(--secondary-neon);
    color: #b580ff;
}

.btn-action:hover:not(:disabled) {
    background: var(--secondary-neon);
    color: white;
    box-shadow: 0 0 15px rgba(112, 0, 255, 0.5);
}

.btn-danger {
    background: rgba(255, 0, 85, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-color);
    color: white;
    box-shadow: var(--danger-glow);
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.3), transparent);
    margin: 8px 0;
}

/* Bottom Section */
.dashboard-footer {
    display: flex;
}

.results-panel {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    padding: 0;
}

.detection-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(2, 12, 27, 0.8);
    padding: 15px 30px;
    border-right: 1px solid var(--border-color);
    min-width: 250px;
}

.detection-result h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.blood-group-box {
    color: #ff0055;
    font-family: 'Orbitron', sans-serif;
    font-size: 38px;
    font-weight: 900;
    text-shadow: var(--danger-glow);
    padding: 5px 20px;
    border: 2px solid #ff0055;
    border-radius: 8px;
    background: rgba(255, 0, 85, 0.05);
    min-width: 120px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(255, 0, 85, 0.2);
}

.parameters-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
    padding: 15px;
    align-items: center;
    justify-content: space-around;
}

.param-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 15px;
    min-width: 100px;
    border-left: 1px solid rgba(0, 243, 255, 0.1);
}

.param-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.param-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-neon);
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.4);
}

.param-item.highlight {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 8px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(2, 12, 27, 0.9);
    border: 1px solid var(--primary-neon);
    color: var(--primary-neon);
    font-family: 'Orbitron', sans-serif;
    padding: 15px 25px;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: var(--primary-glow);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast.error {
    border-color: var(--danger-color);
    color: var(--danger-color);
    box-shadow: var(--danger-glow);
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark); 
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.3); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-neon); 
}
