/* ========================================
   MENÜ YÖNETİM SİSTEMİ - Dark Theme CSS
   ======================================== */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #22223a;
    --bg-input: #16162a;
    --accent: #e94560;
    --accent-hover: #ff6b81;
    --accent-soft: rgba(233, 69, 96, 0.15);
    --text-primary: #f0f0f0;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --border-color: #2a2a40;
    --success: #2ed573;
    --warning: #ffa502;
    --danger: #ff4757;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 32px rgba(233, 69, 96, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

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

/* ========================================
   LAYOUT
   ======================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   PUBLIC HEADER
   ======================================== */

.public-header {
    text-align: center;
    padding: 40px 20px 20px;
}

.public-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.public-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ========================================
   MENU CARD GRID (PUBLIC)
   ======================================== */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 30px 0 60px;
}

.menu-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.menu-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
}

.menu-card__image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: var(--bg-secondary);
}

.menu-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    color: var(--text-muted);
    font-size: 3rem;
}

.menu-card__body {
    padding: 20px;
}

.menu-card__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.menu-card__desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state__text {
    font-size: 1.1rem;
}

/* ========================================
   PDF VIEWER
   ======================================== */

.viewer-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    gap: 8px;
    z-index: 10;
}

.viewer-toolbar__left,
.viewer-toolbar__center,
.viewer-toolbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.viewer-toolbar__center {
    flex: 1;
    justify-content: center;
}

.viewer-toolbar__title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.viewer-page-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.viewer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.viewer-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

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

.viewer-btn:disabled:hover {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.viewer-btn--back {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    width: auto;
    padding: 0 8px;
}

.viewer-canvas-wrapper {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.viewer-canvas-wrapper canvas {
    max-width: 100%;
    height: auto !important;
    box-shadow: var(--shadow);
    border-radius: 4px;
}

/* ========================================
   ADMIN - NAVBAR
   ======================================== */

.admin-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-navbar__brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-navbar__brand svg {
    color: var(--accent);
}

.admin-navbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-navbar__user {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ========================================
   ADMIN - BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn--primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

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

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

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

.btn--danger:hover {
    background: var(--danger);
    color: #fff;
}

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

.btn--icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    justify-content: center;
}

/* ========================================
   ADMIN - DASHBOARD
   ======================================== */

.admin-content {
    padding: 30px 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

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

.admin-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Admin Menu Cards */
.admin-menu-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-menu-card {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 16px;
    transition: var(--transition);
    gap: 16px;
}

.admin-menu-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(233, 69, 96, 0.1);
}

.admin-menu-card__drag {
    cursor: grab;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 4px;
    flex-shrink: 0;
}

.admin-menu-card__drag:active {
    cursor: grabbing;
}

.admin-menu-card__cover {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.admin-menu-card__cover--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.admin-menu-card__info {
    flex: 1;
    min-width: 0;
}

.admin-menu-card__name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-menu-card__meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.admin-menu-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-color);
    border-radius: 26px;
    transition: var(--transition);
}

.toggle__slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked + .toggle__slider {
    background: var(--success);
}

.toggle input:checked + .toggle__slider::before {
    transform: translateX(20px);
}

/* ========================================
   ADMIN - FORMS
   ======================================== */

.form-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 32px;
    max-width: 700px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

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

/* File Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-input);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.upload-zone__icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-zone__text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.upload-zone__hint {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.upload-zone__file-info {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.upload-zone__file-info.active {
    display: flex;
}

.upload-zone__file-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.upload-zone__file-remove {
    color: var(--danger);
    cursor: pointer;
    padding: 4px;
    font-size: 1.2rem;
    background: none;
    border: none;
}

/* Cover Preview */
.cover-preview {
    margin-top: 16px;
    display: none;
}

.cover-preview.active {
    display: block;
}

.cover-preview img {
    max-width: 200px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.cover-preview__label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ========================================
   ADMIN - LOGIN
   ======================================== */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.login-card__title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-card__subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.login-card .btn--primary {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 1rem;
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid;
}

.alert--success {
    background: rgba(46, 213, 115, 0.1);
    border-color: rgba(46, 213, 115, 0.3);
    color: var(--success);
}

.alert--error {
    background: rgba(255, 71, 87, 0.1);
    border-color: rgba(255, 71, 87, 0.3);
    color: var(--danger);
}

.alert--warning {
    background: rgba(255, 165, 2, 0.1);
    border-color: rgba(255, 165, 2, 0.3);
    color: var(--warning);
}

/* ========================================
   BADGE
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge--active {
    background: rgba(46, 213, 115, 0.15);
    color: var(--success);
}

.badge--inactive {
    background: rgba(136, 136, 160, 0.15);
    color: var(--text-muted);
}

.badge--pdf {
    background: rgba(233, 69, 96, 0.15);
    color: var(--accent);
}

.badge--digital {
    background: rgba(112, 161, 255, 0.15);
    color: #70a1ff;
}

/* Menu Type Selector */
.menu-type-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.menu-type-option {
    flex: 1;
    position: relative;
}

.menu-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.menu-type-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    background: var(--bg-input);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.menu-type-option label:hover {
    border-color: var(--text-muted);
}

.menu-type-option input[type="radio"]:checked + label {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.menu-type-option label .type-icon {
    font-size: 2rem;
}

.menu-type-option label .type-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.menu-type-option label .type-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ========================================
   CONFIRM DIALOG
   ======================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal__title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.modal__text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.modal__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 16px;
    color: var(--text-secondary);
}

.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* ========================================
   FOOTER
   ======================================== */

.public-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   SORTABLE
   ======================================== */

.sortable-ghost {
    opacity: 0.4;
}

.sortable-chosen {
    border-color: var(--accent) !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .public-header {
        padding: 24px 16px 12px;
    }

    .public-header h1 {
        font-size: 1.5rem;
    }

    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
        padding: 20px 0 40px;
    }

    .menu-card__image,
    .menu-card__image--placeholder {
        height: 180px;
    }

    .admin-navbar {
        padding: 12px 16px;
    }

    .admin-content {
        padding: 20px 16px;
    }

    .admin-menu-card {
        flex-wrap: wrap;
        gap: 12px;
    }

    .admin-menu-card__info {
        flex: 1 1 calc(100% - 120px);
    }

    .admin-menu-card__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .form-card {
        padding: 24px 20px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .viewer-toolbar {
        padding: 8px 12px;
        flex-wrap: nowrap;
    }

    .viewer-toolbar__title {
        max-width: 120px;
        font-size: 0.85rem;
    }

    .viewer-canvas-wrapper {
        padding: 10px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }

    .admin-menu-card__cover,
    .admin-menu-card__cover--placeholder {
        width: 60px;
        height: 60px;
    }

    .viewer-toolbar__title {
        display: none;
    }
}
