/**
 * Admin Kontrol Paneli - CSS
 * Global Hırdavat
 */

/* Admin Container */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.admin-header .logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-header .logo-icon {
    font-size: 2rem;
}

.admin-header .logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.admin-header .logo-text p {
    font-size: 0.85rem;
    color: #a0aec0;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Stats Section */
.stats-section {
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #16213e 100%);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    border-radius: 12px;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #00d4aa;
}

.stat-label {
    font-size: 0.9rem;
    color: #a0aec0;
}

/* Tabs */
.tabs-section {
    margin-bottom: 1rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(30, 58, 95, 0.5);
    padding: 0.5rem;
    border-radius: 12px;
}

.tab {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: #a0aec0;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.tab.active {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    color: #1a1a2e;
    font-weight: 600;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Panel */
.panel {
    background: linear-gradient(135deg, #1e3a5f 0%, #16213e 100%);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filters input[type="date"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 0.85rem;
}

.filters input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    background: rgba(0, 0, 0, 0.2);
    color: #a0aec0;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.data-table td {
    color: #e2e8f0;
}

.loading-cell {
    text-align: center;
    padding: 2rem !important;
    color: #a0aec0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-barcode {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
}

.badge-text {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.tutar-cell {
    font-weight: 600;
    color: #00d4aa !important;
}

/* Detail Button */
.btn-detail {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-detail:hover {
    background: rgba(99, 102, 241, 0.4);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

#pageInfo {
    color: #a0aec0;
    font-size: 0.9rem;
}

/* Search Log Info */
.search-log-info {
    color: #a0aec0;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: linear-gradient(135deg, #1e3a5f 0%, #16213e 100%);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: #a0aec0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

/* Order Detail */
.order-header-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.order-info-item {
    display: flex;
    flex-direction: column;
}

.order-info-label {
    font-size: 0.75rem;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-info-value {
    font-size: 1rem;
    color: #fff;
    font-weight: 500;
    margin-top: 0.25rem;
}

.order-items-title {
    font-size: 0.9rem;
    color: #a0aec0;
    margin-bottom: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        font-size: 1.75rem;
        padding: 0.5rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        width: 100%;
    }

    .filters input[type="date"] {
        flex: 1;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: column;
    }
}

/* Limit & Usage Styles */
.limit-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: 1rem;
}

.usage-bar-container {
    width: 100%;
    min-width: 150px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.usage-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.usage-bar.success {
    background: #00d4aa;
}

.usage-bar.warning {
    background: #f1c40f;
}

.usage-bar.danger {
    background: #e74c3c;
}

.usage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.badge-success {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
}

.badge-warning {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.badge-danger {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* Limit Modal Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #a0aec0;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.limit-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    text-align: center;
    transition: border-color 0.2s;
}

.limit-input:focus {
    outline: none;
    border-color: #00d4aa;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    color: #1a1a2e;
    font-weight: 600;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Form Input & Select Styles */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #00d4aa;
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-input::placeholder {
    color: #6b7c93;
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-select:focus {
    outline: none;
    border-color: #00d4aa;
}

.form-select option {
    background: #1a1a2e;
    color: #fff;
}

/* User Action Buttons */
.user-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-password {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-password:hover {
    background: rgba(241, 196, 15, 0.4);
}

.btn-delete {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: rgba(231, 76, 60, 0.4);
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-admin {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.role-siparis {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.role-fiyat {
    background: rgba(0, 212, 170, 0.2);
    color: #00d4aa;
}

/* Order Count Badge */
.order-count-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}