/**
 * ATA EMLAK - Admin Panel Stilleri
 */

/* ===== Variables ===== */
:root {
    --primary: #1e3a5f;
    --primary-dark: #152a45;
    --primary-light: #2a4f7a;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg-sidebar: #0f172a;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);

    --sidebar-width: 260px;
    --header-height: 70px;

    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s ease;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
}

input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1rem;
}

.login-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: var(--accent);
}

.login-logo h1 {
    font-size: 1.5rem;
    margin-top: 0.5rem;
    color: var(--primary);
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: var(--text-white);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: var(--text-white);
}

.btn-secondary {
    background: var(--text-muted);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: var(--text-secondary);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

/* ===== Admin Layout ===== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-white);
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-logo i {
    color: var(--accent);
    font-size: 1.5rem;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-label {
    padding: 0.75rem 1.5rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.menu-item {
    margin: 0.25rem 0.75rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.menu-link.active {
    background: var(--primary);
    color: var(--text-white);
}

.menu-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Header */
.admin-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-main);
    border-radius: var(--radius);
}

.header-user i {
    color: var(--primary);
}

/* Content Area */
.content-area {
    padding: 1.5rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    color: var(--accent);
}

.card-body {
    padding: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-white);
}

.stat-icon.primary {
    background: var(--primary);
}

.stat-icon.success {
    background: var(--success);
}

.stat-icon.warning {
    background: var(--warning);
}

.stat-icon.info {
    background: var(--info);
}

.stat-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-main);
}

.table tbody tr:hover {
    background: var(--bg-main);
}

.table-img {
    width: 60px;
    height: 45px;
    border-radius: var(--radius);
    object-fit: cover;
}

.no-img {
    width: 60px;
    height: 45px;
    border-radius: var(--radius);
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-primary {
    background: rgba(30, 58, 95, 0.1);
    color: var(--primary);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: var(--transition);
}

.action-btn.edit {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.action-btn.edit:hover {
    background: var(--info);
    color: var(--text-white);
}

.action-btn.delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.action-btn.delete:hover {
    background: var(--danger);
    color: var(--text-white);
}

.action-btn.view {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.action-btn.view:hover {
    background: var(--success);
    color: var(--text-white);
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title i {
    color: var(--accent);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-main);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-item:hover {
    background: var(--border-color);
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Tab Buttons */
.type-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.type-tab {
    flex: 1;
    padding: 1rem;
    text-align: center;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.type-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.type-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-white);
}

.type-tab input {
    display: none;
}

/* Image Upload */
.image-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.image-upload:hover {
    border-color: var(--primary);
    background: rgba(30, 58, 95, 0.05);
}

.image-upload i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.image-upload p {
    color: var(--text-secondary);
}

.image-upload input {
    display: none;
}

.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.preview-item {
    position: relative;
    width: 100px;
    height: 75px;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

.preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--info);
    color: var(--info);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary);
    color: var(--text-white);
    border-radius: var(--radius);
    font-size: 1.25rem;
    cursor: pointer;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.sidebar-overlay.active {
    display: block;
}

/* ===== Responsive Admin ===== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    /* Sidebar Mobile */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Header Mobile */
    .admin-header {
        padding: 0 1rem;
    }

    .header-title h1 {
        font-size: 1rem;
    }

    .header-user span {
        display: none;
    }

    /* Content Area Mobile */
    .content-area {
        padding: 1rem;
    }

    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-content h3 {
        font-size: 1.25rem;
    }

    .stat-content p {
        font-size: 0.75rem;
    }

    /* Cards Mobile */
    .card-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .card-body {
        padding: 1rem;
    }

    /* Tables Mobile */
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }

    .table-img,
    .no-img {
        width: 50px;
        height: 38px;
    }

    .action-btns {
        flex-wrap: wrap;
    }

    .action-btn {
        width: 28px;
        height: 28px;
    }

    /* Forms Mobile */
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.625rem 0.875rem;
    }

    .checkbox-group {
        flex-direction: column;
    }

    .checkbox-item {
        width: 100%;
    }

    /* Type Tabs Mobile */
    .type-tabs {
        flex-direction: column;
    }

    .type-tab {
        padding: 0.75rem;
    }

    /* Form Actions Mobile */
    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Image Upload Mobile */
    .image-upload {
        padding: 1.5rem;
    }

    .preview-item {
        width: 80px;
        height: 60px;
    }

    /* Buttons Mobile */
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
    }

    /* Empty State Mobile */
    .empty-state {
        padding: 2rem;
    }

    .empty-state i {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .header-user {
        padding: 0.375rem 0.625rem;
    }

    .card-title {
        font-size: 0.875rem;
    }

    /* Hide non-essential columns on very small screens */
    .table .hide-mobile {
        display: none;
    }

    .hide-mobile-text {
        display: none;
    }
}