/* BTS Web Application - Shared Theme CSS */
/* Based on add-bolts.html styling */

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

/* CSS Variables for consistent theming */
:root {
    /* Brand Colors - Logo Palette */
    --paynes-gray: #4b6780;
    --princeton-orange: #f88d0b;
    --hunyadi-yellow: #f0af3a;
    --orange-web: #ffaf4b;
    --peach-yellow: #ffde96;

    --frame-color: #ffffff;
    --gray-900: #1a1a1a;
    --gray-800: #2d2d2d;
    --gray-700: #3a3a3a;
    --gray-600: #4b6780;
    --gray-500: #6b8299;
    --gray-400: #8b9fb5;
    --gray-300: #c5d0db;
    --gray-200: #e5eaef;
    --gray-100: #f5f7f9;

    --blue-500: #4b6780;
    --blue-600: #3d5468;
    --blue-700: #2f4250;

    --red-400: #f87171;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --red-700: #b91c1c;

    --green-500: #10b981;
    --green-600: #059669;
    --green-700: #047857;

    --yellow-400: #ffaf4b;
    --yellow-500: #f0af3a;

    --white: #ffffff;
    --black: #000000;

    /* Semantic colors */
    --primary: var(--princeton-orange);
    --primary-hover: #d97909;
    --secondary: var(--paynes-gray);
    --secondary-hover: #3d5468;
    --danger: var(--red-600);
    --danger-hover: var(--red-700);
    --success: var(--green-600);
    --success-hover: var(--green-700);
    --warning: var(--hunyadi-yellow);

    /* Text colors */
    --text-primary: #e5e7eb;
    --text-secondary: var(--gray-400);
    --text-inverse: var(--white);

    /* Background colors */
    --bg-primary: var(--gray-900);
    --bg-secondary: var(--gray-800);
    --bg-tertiary: var(--gray-700);

    /* Border colors */
    --border-primary: var(--gray-700);
    --border-secondary: var(--paynes-gray);
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.5rem;
    color: var(--white);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1rem;
}

/* Layout utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-grow {
    flex-grow: 1;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Spacing utilities */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-4 { margin: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

/* Page layout components */
.page-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    padding: 1rem;
}

.header-container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
}

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

.main-content-wrapper {
    display: flex;
    flex: 1 1 0%;
    overflow: hidden;
    min-height: calc(100vh - 80px);
}

/* Form elements */
.form-input, .form-select {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    width: 100%;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-input.small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group-item {
    flex: 1 1 0%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--secondary-hover);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

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

.btn-success {
    background-color: var(--success);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background-color: var(--success-hover);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-ghost:hover:not(:disabled) {
    background-color: var(--bg-tertiary);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Icon buttons */
.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cards */
.card {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    overflow: hidden;
}

.card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.card-body {
    padding: 1rem;
}

.card-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-primary);
    background-color: var(--bg-tertiary);
}

/* Navigation */
.nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--primary);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Toolbar */
.toolbar-nav {
    background-color: rgb(17 24 39 / 0.5);
    backdrop-filter: blur(4px);
    padding: 0.75rem;
    margin: 1rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    position: absolute;
    left: 0;
    z-index: 10;
}

.toolbar-button {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 0.375rem;
    transition: background-color 150ms ease-in-out;
    border: none;
    cursor: pointer;
}

.toolbar-button:hover {
    background-color: var(--primary);
}

.toolbar-button.delete:hover {
    background-color: var(--danger);
}

/* Sidebar */
.sidebar {
    width: 20rem;
    background-color: var(--bg-primary);
    padding: 1rem;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    border-left: 1px solid var(--border-primary);
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--white);
}

/* Lists */
.list {
    list-style: none;
}

.list-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.list-item:hover {
    background-color: var(--bg-tertiary);
}

.list-item.active {
    background-color: var(--primary);
    color: var(--white);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--blue-500);
    color: var(--blue-500);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--green-500);
    color: var(--green-500);
}

.alert-warning {
    background-color: rgba(251, 191, 36, 0.1);
    border-color: var(--yellow-500);
    color: var(--yellow-500);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--red-500);
    color: var(--red-500);
}

/* Utilities */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

/* Responsive utilities */
@media (min-width: 768px) {
    .md\\:flex {
        display: flex;
    }
    
    .md\\:hidden {
        display: none;
    }
}

@media (min-width: 1024px) {
    .lg\\:flex {
        display: flex;
    }
    
    .lg\\:hidden {
        display: none;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--gray-600);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Search highlight */
.search-highlight {
    border-color: var(--primary) !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Mode active state */
.mode-active {
    background-color: var(--danger) !important;
    color: var(--white);
}

/* Disable number input arrows */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    color: white;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
    word-wrap: break-word;
}

.notification-info {
    display: none !important; /* Hide info notifications */
}

.notification-success {
    background-color: var(--success);
}

.notification-error {
    background-color: var(--danger);
}

.notification-warning {
    background-color: var(--warning);
    color: var(--gray-900);
}

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