/* ============================================
   admin.css - Admin Panel Styles
   Super Simple & Clean - FIXED
============================================ */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

/* ===== LAYOUT ===== */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: #1e293b;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #334155;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 2rem;
    color: #3b82f6;
}

.logo h2 {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: #94a3b8;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-left-color: #3b82f6;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid #334155;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-details h4 {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.user-details p {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    overflow-y: auto;
    min-height: 100vh;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* ===== PAGE HEADER ===== */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 i {
    color: #3b82f6;
}

.page-header p {
    color: #94a3b8;
    font-size: 1rem;
}

/* ===== STATS CARDS ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #1e293b;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #334155;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 1.5rem;
}

.stat-info h3 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 4px;
    font-weight: 700;
}

.stat-info p {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ===== CREATE CARD ===== */
.create-card {
    background: #1e293b;
    border-radius: 16px;
    padding: 30px;
    border: 1px solid #334155;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group label i {
    color: #3b82f6;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-group input::placeholder {
    color: #64748b;
}

.form-group input.error {
    border-color: #ef4444;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-hint {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 0.85rem;
}

.form-hint i {
    margin-right: 4px;
    color: #fbbf24;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== LINK ITEMS ===== */
.links-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.link-item {
    background: #1e293b;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #334155;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.link-item:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.link-id {
    font-size: 1.2rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-id i {
    font-size: 1rem;
    color: #94a3b8;
}

.link-url {
    color: #10b981;
    font-family: monospace;
    word-break: break-all;
    margin-bottom: 12px;
    font-size: 0.95rem;
    background: #0f172a;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #334155;
}

.link-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.link-meta span i {
    margin-right: 6px;
    color: #3b82f6;
}

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

.link-actions button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: transparent;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.link-actions button:hover {
    transform: translateY(-2px);
}

.btn-copy {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.btn-copy:hover {
    background: rgba(16, 185, 129, 0.2) !important;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2) !important;
}

/* ===== SEARCH BOX ===== */
.search-box {
    position: relative;
    max-width: 400px;
    margin-top: 16px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 30px;
    color: white;
    font-size: 0.95rem;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
}

.search-box input::placeholder {
    color: #64748b;
}

/* ===== LOADING & EMPTY STATES ===== */
.loading-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.loading-state i,
.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1e293b;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    padding: 16px 24px;
    color: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

.notification.success {
    border-left-color: #10b981;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification i {
    font-size: 1.2rem;
}

.notification.success i {
    color: #10b981;
}

.notification.error i {
    color: #ef4444;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .link-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .create-card {
        padding: 20px;
    }
    
    .link-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}