/* Admin Dashboard Styles */
.admin-body {
    background-color: var(--bg-darker);
    padding-top: 80px;
}

.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.admin-nav-actions {
    display: flex;
    gap: 10px;
}

.admin-badge {
    font-size: 0.8rem;
    background: var(--orange-primary);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 10px;
    font-weight: normal;
}

.admin-main {
    padding-top: 40px;
    padding-bottom: 60px;
}

.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    /* Layout */
    .admin-sidebar { display: none; }
    .admin-layout  { grid-template-columns: 1fr; gap: 0; }

    /* Header kompakt */
    .admin-body    { padding-top: 62px; }
    .admin-header  { padding: 8px 0; }
    .admin-badge   { display: none; }
    .nav-logo-img  { height: 32px; }
    .admin-nav-actions .btn { font-size: 0.72rem; padding: 7px 10px; }

    /* Content */
    .admin-main    { padding-top: 16px; padding-bottom: 30px; }
    .admin-content { padding: 16px; }
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .content-header h2 { font-size: 1.1rem; }
    .content-header .btn { width: 100%; justify-content: center; min-height: 48px; }

    /* Referans liste kartları — tam genişlik, dokunulabilir */
    .reference-item {
        flex-direction: column !important;
        gap: 0;
        border-radius: var(--radius-sm);
        overflow: hidden;
        margin-bottom: 14px;
    }
    .reference-item img {
        width: 100% !important;
        height: 180px !important;
        object-fit: cover;
        border-radius: 0 !important;
        flex-shrink: 0;
    }
    .reference-item-info { padding: 12px 14px 6px; }
    .reference-item-info h3 { font-size: 1rem; }
    .reference-item-actions {
        display: flex !important;
        gap: 8px;
        padding: 8px 14px 14px;
    }
    .reference-item-actions .btn {
        flex: 1;
        min-height: 44px;
        font-size: 0.85rem;
        justify-content: center;
    }

    /* Modal → alttan açılan bottom sheet */
    .modal {
        padding: 0 !important;
        align-items: flex-end !important;
    }
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92vh !important;
        border-radius: 16px 16px 0 0 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        animation: slideUpSheet .3s ease;
    }
    @keyframes slideUpSheet {
        from { transform: translateY(60%); opacity: .5; }
        to   { transform: translateY(0);   opacity: 1; }
    }
    .modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--bg-card);
        border-radius: 16px 16px 0 0;
        padding: 14px 20px;
    }
    .modal-header::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--border-color);
        border-radius: 2px;
        margin: 0 auto 12px;
    }
    .modal-body  { padding: 16px 20px; }
    .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--bg-card);
        padding: 12px 20px max(16px, env(safe-area-inset-bottom));
        flex-direction: column-reverse;
        gap: 8px;
        border-top: 1px solid var(--border-color);
    }
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        font-size: 1rem;
    }

    /* Form alanları dokunma dostu */
    .form-group { margin-bottom: 16px; }
    .form-group label { font-size: 0.85rem; margin-bottom: 6px; }
    .form-group input[type="text"],
    .form-group select,
    .form-group textarea {
        padding: 14px 12px;
        font-size: 1rem;
    }
    .form-group textarea { min-height: 100px; }
    .form-group input[type="file"] { padding: 12px; font-size: 0.9rem; }

    /* Login kartı mobil */
    .login-card { padding: 28px 20px; }
    .login-header h2 { font-size: 1.5rem; }
}

.admin-sidebar {
    padding: 20px;
    height: fit-content;
}

.admin-menu {
    list-style: none;
}

.admin-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.admin-menu li a:hover, .admin-menu li a.active {
    background: rgba(255, 107, 0, 0.1);
    color: var(--orange-primary);
}

.admin-content {
    padding: 30px;
}

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal.show .modal-content {
    transform: translateY(0);
}

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

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

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

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

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

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-body);
    transition: var(--transition);
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--orange-primary);
    box-shadow: 0 0 0 2px rgba(255,107,0,0.2);
}

.form-group.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.form-group.checkbox-group input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-group.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}

.form-group select option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

.form-group input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(22, 24, 29, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius-md);
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,107,0,0.2);
    border-top-color: var(--orange-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Reference Item Card in Admin */
.admin-ref-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.admin-ref-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.admin-ref-info {
    flex: 1;
}

.admin-ref-title {
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-badge {
    font-size: 0.7rem;
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.admin-ref-cat {
    font-size: 0.8rem;
    color: var(--orange-primary);
}

.admin-ref-actions {
    display: flex;
    gap: 10px;
}

/* Login Overlay Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-darker);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    animation: fadeInDown 0.5s ease-out;
}

.login-header {
    margin-bottom: 30px;
}

.login-logo {
    height: 60px;
    margin-bottom: 20px;
}

.login-header h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"] {
    width: 100%;
    padding: 13px 46px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    text-align: left;
}

.password-input-wrapper input[type="password"]::placeholder,
.password-input-wrapper input[type="text"]::placeholder {
    color: var(--text-muted);
}

.password-input-wrapper input:focus {
    border-color: var(--orange-primary);
    box-shadow: 0 0 0 2px rgba(255,107,0,0.18);
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.9rem;
}

.pw-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    font-size: 0.9rem;
    transition: color .2s;
    line-height: 1;
    display: flex;
    align-items: center;
}

.pw-toggle-btn:hover { color: var(--orange-primary); }

.btn-block {
    width: 100%;
    margin-top: 10px;
}

.login-error {
    margin-top: 15px;
    color: #ff4d4d;
    font-size: 0.85rem;
    background: rgba(255, 77, 77, 0.1);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 77, 77, 0.2);
}

.hidden {
    display: none !important;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

