/* Basic Reset & Typography */

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

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #111827;
    color: #f3f4f6;
    line-height: 1.5;
}


/* Screens */

.screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


/* Login Screen */

#login-screen {
    background-image: linear-gradient(rgba(0, 238, 255, 0.5), rgba(8, 7, 7, 0.5)), url('kavak_yukardan.jpeg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    /* Optional, but keeps the image centered */
    min-height: 100vh;
    height: auto;
    align-items: center;
    justify-content: center;
    background-color: #1f2937;
}

.login-card {
    background-image: url('seyit.jpeg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    /* Optional, but keeps the image centered */
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.login-card p {
    color: #020204;
    margin-bottom: 1.5rem;
}


/* Inputs & Buttons */

.input-group {
    margin-bottom: 1rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

input[type="text"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.5rem;
    background: #1f2937;
    color: #f3f4f6;
    border: 1px solid #4b5563;
    border-radius: 4px;
    font-family: inherit;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    background-color: #4b5563;
    color: #f3f4f6;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #6b7280;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.draggable-prototypes {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.proto-btn {
    font-size: 1.5rem;
    cursor: grab;
    padding: 0.25rem 0.5rem;
    background: #374151;
    border-radius: 4px;
    user-select: none;
    touch-action: none;
    /* For mobile drag-drop */
}

.proto-btn:active {
    cursor: grabbing;
}

.proto-btn:hover {
    background: #4b5563;
}


/* Dashboard Header */

.app-header {
    background: #1f2937;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #374151;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #d1d5db;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.countdown-item span {
    font-size: 1.25rem;
}

.countdown-item small {
    font-size: 0.65rem;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: 1px solid #374151;
    padding-left: 1rem;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}


/* Main Layout */

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    /* Prevent body scroll if content is long */
}


/* Sidebar (People) */

.sidebar {
    width: 250px;
    background: #1f2937;
    border-right: 1px solid #374151;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.sidebar-help {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.people-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}


/* Draggable User Blob */

.user-blob {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 20px;
    cursor: grab;
    user-select: none;
    touch-action: none;
    /* For mobile drag-drop */
    flex-shrink: 0;
}

.user-blob:active {
    cursor: grabbing;
}

.user-blob.assigned {
    opacity: 0.5;
}

.user-blob .avatar {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
}

.user-blob span {
    font-size: 0.875rem;
    font-weight: 500;
}

.scene-container {
    flex: 1;
    background-color: #111827;
    position: relative;
    overflow: auto;
    /* Allow scrolling on mobile if board is large */
}


/* Trash Can */

.trash-can {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: rgba(55, 65, 81, 0.8);
    border: 2px dashed #4b5563;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    z-index: 50;
    transition: all 0.2s ease;
    opacity: 0.5;
}

.trash-can.active {
    opacity: 1;
    background: rgba(127, 29, 29, 0.8);
    border-color: #ef4444;
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.scene-board {
    width: 100%;
    height: 100%;
    min-width: 800px;
    /* Ensure there is always a minimum canvas size for landscape dragging */
    min-height: 600px;
    position: relative;
    /* Subtle grid background to look like a board */
    background-image: radial-gradient(#374151 1px, transparent 0);
    background-size: 20px 20px;
    overflow: visible;
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #9ca3af;
    padding: 2rem;
    background: rgba(31, 41, 55, 0.8);
    border-radius: 8px;
    border: 1px dashed #4b5563;
    pointer-events: none;
}

.vehicle-object {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: move;
    z-index: 5;
    touch-action: none;
    /* For mobile pointer dragging */
}

.vehicle-object.dragging {
    opacity: 0.8;
}

.vehicle-visual {
    position: relative;
}

.vehicle-img {
    display: block;
    pointer-events: none;
    /* Dimensions will be set via inline styles or classes based on type */
}


/* Delete Button */

.delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #1f2937;
    border: 1px solid #ef4444;
    color: #f87171;
    cursor: pointer;
    font-size: 1rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.delete-btn:hover {
    background: #7f1d1d;
}


/* Info Text Below Image */

.vehicle-info {
    margin-top: 0.5rem;
    text-align: center;
    background: rgba(31, 41, 55, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #374151;
    color: #d1d5db;
    font-size: 0.85rem;
    max-width: 200px;
    cursor: pointer;
    /* Click to edit */
}

.vehicle-info h3 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
    color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.vehicle-info:hover {
    border-color: #4b5563;
    background: rgba(55, 65, 81, 0.9);
}

.edit-icon {
    font-size: 0.8rem;
    opacity: 0.7;
}


/* Seat Overlay */

.seat {
    position: absolute;
    width: 48px;
    height: 52px;
    background: rgba(31, 41, 55, 0.7);
    backdrop-filter: blur(2px);
    border: 2px dashed #4b5563;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.seat.empty.drag-over {
    background: rgba(30, 58, 138, 0.9);
    border-color: #3b82f6;
}

.seat.occupied {
    border-style: solid;
}

.seat-label {
    display: none;
}

.seat-name {
    font-size: 9px;
    font-weight: 600;
    color: #f3f4f6;
    text-align: center;
    max-width: 48px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-top: 2px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}


/* Car seat pixel positions (car img = 160px wide) */


/* Front row: driver left, front-right passenger */

.car-seat-0 {
    top: 28px;
    left: 14px;
}

.car-seat-1 {
    top: 28px;
    right: 14px;
}


/* Back row: spread across 160px with seats being 44px each, leaving gaps */

.car-seat-2 {
    bottom: 18px;
    left: 6px;
}

.car-seat-3 {
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
}

.car-seat-4 {
    bottom: 18px;
    right: 6px;
}

.plane-dropzone {
    position: absolute;
    top: 20%;
    left: 10%;
    width: 80%;
    height: 60%;
    background: rgba(31, 41, 55, 0.5);
    border: 2px dashed transparent;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.4rem;
}


/* Bus dropzone over the windows */

.bus-dropzone {
    position: absolute;
    top: 25%;
    left: 20%;
    width: 75%;
    height: 45%;
    background: rgba(31, 41, 55, 0.3);
    border: 2px dashed transparent;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0.4rem;
    overflow-y: auto;
}


/* Passenger chip for plane/bus — shows avatar + name in a pill */

.passenger-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(31, 41, 55, 0.85);
    border: 1px solid;
    border-radius: 20px;
    padding: 2px 6px 2px 3px;
    position: relative;
}

.passenger-name {
    font-size: 10px;
    font-weight: 600;
    color: #f3f4f6;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.chip-remove-btn {
    background: rgba(55, 65, 81, 0.9);
    border: 1px solid #6b7280;
    border-radius: 50%;
    color: #d1d5db;
    cursor: pointer;
    width: 14px;
    height: 14px;
    font-size: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.plane-dropzone.drag-over,
.bus-dropzone.drag-over {
    background: rgba(30, 58, 138, 0.8);
    border-color: #3b82f6;
}


/* Toasts */

#toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 50;
}

.toast {
    background: #374151;
    color: #f3f4f6;
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease-out;
}

.toast.error {
    border-color: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}


/* Modal Overlay */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: #1f2937;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.25rem;
}

.close-btn:hover {
    color: #f3f4f6;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #374151;
    display: flex;
    justify-content: flex-end;
}


/* Media Queries for Mobile Responsiveness */

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .main-layout {
        flex-direction: column;
    }
    /* Make sidebar a horizontal scrolling bar at the top */
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 140px;
        border-right: none;
        border-bottom: 1px solid #374151;
        padding: 0.5rem;
    }
    .people-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
    }
    .sidebar h3,
    .sidebar-help {
        text-align: left;
        margin-bottom: 0.25rem;
    }
    /* Scale down UI for mobile screens */
    .trash-can {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        bottom: 1rem;
        right: 1rem;
    }
}