/* Brashears Admin - Sidebar Layout */

:root {
    --primary: #c41e3a;
    --primary-dark: #9a1830;
    --primary-light: #e85a6f;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #1a1a1a;
    --text-muted: #666666;
    --border: #e0e0e0;
    --success: #28a745;
    --error: #dc3545;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --sidebar-width: 240px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* App Layout with Sidebar */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Red Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(196, 30, 58, 0.80);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo a {
    display: block;
}

.sidebar-logo img {
    max-width: 100%;
    height: auto;
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
}

.sidebar-nav li a {
    display: block;
    padding: 0.875rem 1.5rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav li a.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: white;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-settings {
    display: block;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.sidebar-settings:hover,
.sidebar-settings.active {
    color: white;
}

.sidebar-user {
    display: block;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.content-header {
    background: var(--card-bg);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.header-logo {
    height: 50px;
    width: auto;
}

.content-body {
    padding: 2rem;
    max-width: 1200px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0,0,0,0.02) 10px,
        rgba(0,0,0,0.02) 20px
    );
}

.drop-zone:hover {
    border-color: var(--primary);
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(196, 30, 58, 0.03) 10px,
        rgba(196, 30, 58, 0.03) 20px
    );
}

.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(196, 30, 58, 0.05);
}

.drop-zone-text {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border);
}

.drop-zone input[type="file"] {
    display: none;
}

/* Messages */
.message {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Template List */
.template-list {
    margin-top: 2rem;
}

.template-list h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.template-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.template-item .template-name {
    font-size: 0.9rem;
    color: var(--text);
}

.template-item .template-actions {
    display: flex;
    gap: 0.5rem;
}

.template-item .action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.template-item .action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.template-item .delete-btn {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.template-item .delete-btn:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* Create Tags Layout */
.create-tags-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

/* Form Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

select.form-control {
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

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

.btn-success:hover {
    background: #218838;
}

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

.btn-danger:hover {
    background: #c82333;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Modal / Dialog */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.2s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Search Results */
.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.result-section {
    margin-bottom: 1.5rem;
}

.result-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.result-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: var(--bg);
}

.result-item:hover {
    background: #e8e8e8;
}

.result-checkbox {
    margin-right: 1rem;
    margin-top: 0.25rem;
}

.result-info {
    flex: 1;
}

.result-sku {
    font-weight: 600;
    color: var(--text);
}

.result-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.result-vendor {
    font-size: 0.8rem;
    color: var(--primary);
    margin-top: 0.25rem;
}

.result-components {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border);
}

.result-component {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.25rem 0;
}

.result-qty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.result-qty input {
    width: 60px;
    padding: 0.4rem;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.qty-input {
    width: 60px;
    padding: 0.4rem;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* Queue */
.queue-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.queue-count {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
}

.queue-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border-radius: 4px;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.queue-item .remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}

.queue-item .remove-btn:hover {
    color: var(--error);
}

.queue-item.kit {
    border-left: 3px solid var(--primary);
}

.queue-item.sibling {
    border-left: 3px solid var(--primary-light);
    background: #fff5f5;
}

/* Clear Queue Button - RED and LARGER */
.btn-clear-queue {
    background: var(--error);
    color: white;
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
}

.btn-clear-queue:hover {
    background: #c82333;
}

/* Download Links */
.download-links {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #d4edda;
    border-radius: 8px;
}

.download-links h4 {
    color: #155724;
    margin-bottom: 1rem;
}

.download-link {
    color: #155724;
    text-decoration: underline;
    font-weight: 600;
    font-size: 1.1rem;
}

.download-link:hover {
    color: #0d3d15;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: hidden;
    }
    
    .sidebar-logo img {
        display: none;
    }
    
    .sidebar-nav li a {
        padding: 1rem;
        text-align: center;
        font-size: 0;
    }
    
    .sidebar-nav li a::before {
        font-size: 1.25rem;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .content-body {
        padding: 1rem;
    }
}
