/**
 * SkiSchool ERP - Styles
 */

/* === BASE === */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: #f8fafc;
}

/* === GRID CELLS === */
.cell-base {
    position: relative;
    height: 100%;
    padding: 4px 8px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
}

.cell-booked {
    border-left: 4px solid #3b82f6;
}

.cell-sold {
    border-left: 4px solid #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, transparent 100%);
}

.cell-pending {
    border-left: 4px solid #f59e0b;
    animation: pulse-border 2s infinite;
}

.cell-request {
    border-left: 4px solid #8b5cf6;
    border-style: dashed;
}

.cell-abs {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-weight: bold;
    font-size: 10px;
    border-radius: 4px;
    min-height: 44px;
}

/* === RESIZE HANDLES === */
.resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
    background: transparent;
    transition: background 0.15s;
    z-index: 5;
}

.resize-handle:hover {
    background: rgba(59, 130, 246, 0.3);
}

.resize-handle.resize-left {
    left: 0;
    border-radius: 4px 0 0 4px;
}

.resize-handle.resize-right {
    right: 0;
    border-radius: 0 4px 4px 0;
}

/* === MOVE HANDLE === */
.move-handle {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: rgba(0, 0, 0, 0.4);
    cursor: move;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    z-index: 5;
    user-select: none;
}

.cell-base:hover .move-handle,
.cell-abs:hover .move-handle {
    opacity: 1;
}

.move-handle:hover {
    background: rgba(255, 255, 255, 0.9);
    color: rgba(0, 0, 0, 0.7);
}

/* === DRAGGING STATE === */
.dragging {
    opacity: 0.5;
}

.drag-preview {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    padding: 8px 12px;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    font-size: 12px;
    font-weight: bold;
}

@keyframes pulse-border {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === SELECTION === */
.selected-cell {
    background: #dbeafe !important;
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

/* === CONTEXT MENU === */
.ctx-menu {
    animation: fadeIn 0.1s ease-out;
}

.ctx-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: background 0.1s;
}

.ctx-btn:hover {
    background: #f3f4f6;
}

.ctx-reserve { color: #2563eb; }
.ctx-sell { color: #16a34a; }
.ctx-abs { color: #dc2626; }
.ctx-clear { color: #6b7280; }
.ctx-info { color: #0891b2; }

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease-out;
}

.modal-window {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: slideUp 0.2s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

/* === FORMS === */
.form-row {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* === TOOLTIP === */
.tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.15s ease-out;
}

/* === QUEUE ITEM === */
.queue-item {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: white;
    transition: all 0.2s;
}

.queue-item.waiting {
    border-color: #fbbf24;
    background: #fffbeb;
}

.queue-item.urgent {
    border-color: #f87171;
    background: #fef2f2;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(248, 113, 113, 0); }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* === UTILITIES === */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
