/* =====================================================
   Casino Promotional Asset Generator
   Admin Interface Styles
   ===================================================== */

:root {
    --bg-dark: #0f0f0f;
    --bg-panel: #1a1a1a;
    --bg-card: #242424;
    --bg-input: #2d2d2d;
    --border-color: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent-red: #CC0000;
    --accent-red-hover: #ff1a1a;
    --accent-green: #22c55e;
    --accent-yellow: #eab308;
    --accent-blue: #3b82f6;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-red);
    margin-bottom: 4px;
}

.sidebar-header span {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 20px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

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

.nav-link.active {
    background: var(--bg-card);
    color: var(--accent-red);
    border-left-color: var(--accent-red);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px 40px;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
}

.page-subtitle {
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

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

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

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
}

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

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Cards */
.card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-red);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Color Input */
.color-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 50px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.color-input-group input[type="text"] {
    flex: 1;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--accent-red);
    background: rgba(204, 0, 0, 0.05);
}

.file-upload.has-file {
    border-style: solid;
    border-color: var(--accent-green);
}

.file-upload input {
    display: none;
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--text-muted);
}

.file-upload-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.file-upload-preview {
    max-width: 200px;
    max-height: 150px;
    margin: 12px auto 0;
    border-radius: var(--radius-sm);
}

/* Radio & Checkbox Groups */
.radio-group, .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-option, .checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover, .checkbox-option:hover {
    border-color: var(--text-muted);
}

.radio-option.selected, .checkbox-option.selected {
    border-color: var(--accent-red);
    background: rgba(204, 0, 0, 0.1);
}

.radio-option input, .checkbox-option input {
    accent-color: var(--accent-red);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg-card);
}

tr:hover td {
    background: var(--bg-card);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.draft {
    background: rgba(234, 179, 8, 0.15);
    color: var(--accent-yellow);
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
}

.status-badge.archived {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-red);
    border-bottom-color: var(--accent-red);
}

/* Property Columns */
.property-columns {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.property-column {
    flex: 1;
    min-width: 350px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.property-column-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.property-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.property-column-title {
    font-size: 16px;
    font-weight: 600;
}

/* Asset Grid */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.asset-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.asset-card:hover {
    border-color: var(--text-muted);
}

.asset-card.selected {
    border-color: var(--accent-red);
    background: rgba(204, 0, 0, 0.1);
}

.asset-card-preview {
    aspect-ratio: 1;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.asset-card-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.asset-card-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.asset-card-size {
    font-size: 12px;
    color: var(--text-muted);
}

/* Preview Panel */
.preview-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: sticky;
    top: 32px;
}

.preview-container {
    background: #ffffff;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.preview-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

/* Asset Preview */
.asset-preview {
    position: relative;
    background: #fff;
    overflow: hidden;
}

.asset-preview-scaled {
    transform-origin: top left;
}

/* Draggable Object */
.promo-object {
    position: absolute;
    cursor: move;
    user-select: none;
    transition: box-shadow 0.2s;
}

.promo-object:hover {
    box-shadow: 0 0 0 2px var(--accent-red);
}

.promo-object.dragging {
    opacity: 0.8;
    box-shadow: 0 0 0 3px var(--accent-red);
}

/* Z-Index Toggle */
.z-toggle {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: var(--bg-dark);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
}

/* Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* Spacing Utilities */
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

/* Text Utilities */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 12px; }
.text-center { text-align: center; }

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.alert-error {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid #dc2626;
    color: #dc2626;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    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(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 24px;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Export Panel */
.export-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.export-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.export-btn:hover {
    border-color: var(--accent-red);
    background: rgba(204, 0, 0, 0.1);
}

.export-btn svg {
    width: 32px;
    height: 32px;
    color: var(--accent-red);
}

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

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

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

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

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease;
}

/* Print Preview Specific */
.print-preview-container {
    background: #e0e0e0;
    padding: 20px;
    border-radius: var(--radius-md);
}

.print-preview-page {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    margin: 0 auto;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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