/**
 * Hilal Yılmaz - Admin Panel Stilleri
 */

:root {
    --primary: #c9a0a0;
    --primary-dark: #a67c7c;
    --white: #ffffff;
    --light: #f8f9fa;
    --gray: #6c757d;
    --dark: #1a1a1a;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --sidebar-width: 260px;
    --header-height: 60px;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--light);
    color: var(--dark);
    display: flex;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-left-color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== HEADER ==================== */
.header {
    height: var(--header-height);
    background: var(--white);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* ==================== CONTENT ==================== */
.content {
    flex: 1;
    padding: 1.5rem;
}

/* ==================== CARDS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--white);
}

.stat-card-icon.books { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card-icon.blog { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-card-icon.users { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.stat-card-icon.comments { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--gray);
}

/* ==================== PANEL ==================== */
.panel {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.panel-body {
    padding: 1.5rem;
}

/* ==================== TABLE ==================== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light);
}

.table th {
    font-weight: 600;
    color: var(--gray);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover {
    background: var(--light);
}

.table-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201, 160, 160, 0.15);
}

.form-control::placeholder {
    color: #adb5bd;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

/* Image Upload */
.image-upload {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.image-upload:hover {
    border-color: var(--primary);
    background: rgba(201, 160, 160, 0.05);
}

.image-upload i {
    font-size: 2.5rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.image-upload p {
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.image-upload span {
    font-size: 0.8125rem;
    color: #adb5bd;
}

.image-preview {
    position: relative;
    display: inline-block;
    margin-top: 1rem;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--white);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 201;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

/* Video Player Modal - Büyük */
#playerModal {
    max-width: 1100px;
    width: 95%;
}

#playerModal .modal-body {
    padding: 0;
}

#playerContainer {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    background: #000;
}

#playerContainer iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--light);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--dark);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
}

.toast.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--dark); }

/* ==================== BADGE ==================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }

/* ==================== SPINNER ==================== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .modal {
        width: 95%;
    }
}


/* ==================== QUILL EDITOR ==================== */
.ql-toolbar.ql-snow {
    border: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    background: #f8f9fa;
}

.ql-container.ql-snow {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.ql-editor {
    min-height: 250px;
    line-height: 1.7;
}

.ql-editor p {
    margin-bottom: 1rem;
}

.ql-editor h1, .ql-editor h2, .ql-editor h3 {
    margin: 1.5rem 0 0.75rem;
}

/* Details/Summary for collapsible sections */
details summary {
    padding: 0.5rem 0;
}

details[open] summary {
    margin-bottom: 0.5rem;
}

.badge-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-warning {
    background: var(--warning);
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}


/* ==================== LANGUAGE SECTIONS ==================== */
.lang-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #fafafa;
    border-radius: 10px;
    border: 1px solid #eee;
}

.lang-header {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-flag {
    font-size: 1.25rem;
}

.lang-buttons {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.lang-btn-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn-toggle:hover {
    border-color: var(--primary);
    background: #fff5f5;
}

.lang-btn-toggle i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.lang-collapsible {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quill-editor {
    height: 280px;
    background: #fff;
}


/* ==================== SETTINGS PAGE ==================== */
.settings-section-title {
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    color: #333;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-section-title:first-of-type {
    margin-top: 0;
}

.settings-section-title i {
    color: var(--primary);
}

/* Color Input */
.color-input {
    height: 45px;
    padding: 5px;
    cursor: pointer;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border: 1px solid #ddd;
    border-radius: 4px;
}
