/* Admin Panel Styles */
:root {
    --primary-color: #4f46e5;
    --secondary-color: #6366f1;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --sidebar-width: 250px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    transform: translateX(0);
}

/* Desktop'ta sidebar herzaman açık */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .main-content {
        margin-left: var(--sidebar-width) !important;
        width: calc(100% - var(--sidebar-width)) !important;
    }
    
    .btn-toggle-sidebar {
        display: none !important;
    }
}

/* Mobile'da sidebar kapalı */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%) !important;
        width: 280px !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        z-index: 9999 !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .sidebar.show {
        transform: translateX(0) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* HAMBURGER BUTONU - HER ZAMAN GÖRÜNÜR */
    .btn-toggle-sidebar {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        top: 15px !important;
        left: 15px !important;
        z-index: 10001 !important; /* Sidebar'den yüksek */
        background: #343a40 !important;
        border: none !important;
        color: white !important;
        padding: 10px !important;
        border-radius: 5px !important;
        cursor: pointer !important;
        font-size: 1.2rem !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    }
    
    /* Sidebar açıkken hamburger'i en üstte */
    .sidebar.show ~ .main-content .btn-toggle-sidebar {
        z-index: 10002 !important;
    }
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.2rem;
}

.sidebar .nav {
    padding: 20px 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 25px;
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Header */
.header {
    background: white;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--dark-color);
    cursor: pointer;
    display: none;
}

.header-left h5 {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--dark-color);
}

/* Content Sections */
.content-section {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-info h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: none;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 10px 10px 0 0 !important;
    padding: 15px 20px;
    border: none;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--light-color);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--dark-color);
}

.table td {
    vertical-align: middle;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #16a34a);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
    border: none;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
}

/* Forms */
.form-control {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 12px;
}

/* File and Telegram Link Cards */
.link-card {
    background: var(--light-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.link-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.link-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 10px;
}

.link-title {
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.link-url {
    color: var(--info-color);
    word-break: break-all;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px; /* Mobile'da biraz daha geniş */
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 9999;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .btn-toggle-sidebar {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 10000;
        background: #343a40;
        border: none;
        color: white;
        padding: 10px;
        border-radius: 5px;
        cursor: pointer;
    }
    
    /* Overlay for mobile sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Mobilde nav-link tıklayınca sidebar'ı zorla kapat */
    .sidebar-overlay.show ~ .main-content .nav-link:active,
    .sidebar-overlay.show ~ .main-content .nav-link:focus {
        pointer-events: none;
    }
    
    /* Mobilde sidebar'ı her zaman kapalı tut (nav-link tıklandığında) */
    .sidebar.show:has(~ .main-content .nav-link:active) {
        transform: translateX(-100%) !important;
    }
    
    .stat-card {
        margin-bottom: 15px;
    }
    
    .header-left h5 {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    /* Modal mobile uyumluluğu */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-body {
        padding: 15px;
    }
    
    /* Form row mobile */
    .row .col-md-4 {
        margin-bottom: 10px;
    }
    
    /* Butonlar mobile */
    .btn-group .btn {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
    
    /* Table mobile scroll */
    .table-responsive {
        max-height: 400px;
        overflow-y: auto;
    }
    
    /* Dashboard stats mobile */
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stat-icon {
        margin: 0 auto;
    }
    
    /* Content sections mobile */
    .content-section {
        width: 100%;
        padding: 15px;
    }
    
    /* Ensure full width on mobile */
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 576px) {
    .content-section {
        padding: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
    
    .link-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .link-actions .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    /* Table mobile */
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 8px 5px;
    }
    
    /* Modal mobile küçük ekranlar */
    .modal-header {
        padding: 10px 15px;
    }
    
    .modal-footer {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Form input mobile */
    .form-control,
    .form-select {
        font-size: 16px; /* iOS zoom önlemi */
        padding: 12px;
    }
    
    /* Sidebar mobile */
    .sidebar {
        width: 100%;
        max-width: 300px;
    }
    
    .sidebar-header h4 {
        font-size: 1rem;
    }
    
    .sidebar .nav-link {
        padding: 15px 20px;
        font-size: 0.9rem;
    }
    
    /* Header mobile */
    .header {
        padding: 10px 15px;
        height: auto;
        min-height: 60px;
        flex-direction: column;
        gap: 10px;
    }
    
    .header-left,
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .status-indicator {
        font-size: 0.8rem;
    }
    
    /* Card mobile */
    .card {
        margin-bottom: 15px;
    }
    
    .card-header {
        padding: 12px 15px;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    /* Button mobile */
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    /* Toast mobile */
    .custom-toast {
        min-width: auto;
        width: calc(100% - 40px);
        margin: 0 20px;
    }
    
    /* Badge mobile */
    .badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    /* Code block mobile */
    code {
        font-size: 0.8rem;
        word-break: break-all;
    }
    
    /* Small text mobile */
    .small,
    small {
        font-size: 0.75rem;
    }
    
    /* Form label mobile */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    /* Input placeholder mobile */
    ::placeholder {
        font-size: 0.9rem;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

.custom-toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px;
    margin-bottom: 10px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast-info {
    border-left: 4px solid var(--info-color);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

/* User Profile Section */
.user-profile-section {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.user-plan {
    font-size: 0.9rem;
}

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

/* Plan Badges */
.plan-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-freemium {
    background: #6c757d;
    color: white;
}

.plan-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.plan-firemium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    animation: firemiumGlow 2s ease-in-out infinite alternate;
}

@keyframes firemiumGlow {
    from { box-shadow: 0 0 5px rgba(245, 87, 108, 0.5); }
    to { box-shadow: 0 0 20px rgba(245, 87, 108, 0.8); }
}

/* License Display */
.license-display {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.license-key {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    word-break: break-all;
    margin-bottom: 10px;
}

.license-status .badge {
    font-size: 0.9rem;
}

/* Feature Cards */
.feature-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-card i {
    font-size: 2rem;
    margin-bottom: 15px;
}

.feature-card h7 {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.feature-card p {
    color: #6c757d;
    margin: 0;
}

/* Theme Selector */
.theme-selector {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

.theme-selector .form-check {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.theme-selector .form-check:hover {
    background-color: #e9ecef;
}

.theme-selector .form-check-input:checked + .form-check-label {
    font-weight: 600;
    color: var(--primary-color);
}

/* Premium Features */
.premium-features .row {
    gap: 20px;
}

.premium-features .col-md-6 {
    flex: 0 0 calc(50% - 10px);
    max-width: calc(50% - 10px);
}

/* Freemium Restrictions */
.alert-warning {
    border-left: 4px solid #ffc107;
}

.alert-warning h6 {
    color: #856404;
    margin-bottom: 15px;
}

.alert-warning ul {
    margin-bottom: 20px;
}

.alert-warning li {
    margin-bottom: 5px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .user-profile-section {
        padding: 15px;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .user-avatar {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .user-actions {
        justify-content: center;
    }
    
    .premium-features .row {
        flex-direction: column;
    }
    
    .premium-features .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    .feature-card {
        margin-bottom: 15px;
    }
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
