/* SiliconPin Site CSS - Custom Theme */

/* =================================
   CUSTOM THEME COLOR PALETTE
   ================================= */

:root {
    /* Primary Brand Colors - Indigo Theme */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #4F46E5;
    --primary-600: #4338ca;
    --primary-700: #3730a3;
    --primary-800: #312e81;
    --primary-900: #1e1b4b;

    /* Secondary Accent - Cyan Theme */
    --secondary-50: #ecfeff;
    --secondary-100: #cffafe;
    --secondary-200: #a5f3fc;
    --secondary-300: #67e8f9;
    --secondary-400: #22d3ee;
    --secondary-500: #06B6D4;
    --secondary-600: #0891b2;
    --secondary-700: #0e7490;
    --secondary-800: #155e75;
    --secondary-900: #164e63;

    /* Accent Color - Warm Highlight */
    --accent-50: #fffbeb;
    --accent-100: #fef3c7;
    --accent-200: #fde68a;
    --accent-300: #fcd34d;
    --accent-400: #fbbf24;
    --accent-500: #F59E0B;
    --accent-600: #d97706;
    --accent-700: #b45309;
    --accent-800: #92400e;
    --accent-900: #78350f;

    /* Neutral Base - Clean Gray */
    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-600: #4b5563;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;

    /* Background Colors - Balanced Medium Theme */
    --bg-primary: #E8EAED;      /* balanced medium background */
    --bg-secondary: #DDE1E6;    /* slightly darker for sections */
    --bg-tertiary: #F4F6F8;     /* cards - lighter but not white */
    --bg-overlay: rgba(232, 234, 237, 0.95);

    /* Text Colors - Medium Theme */
    --text-primary: #2C3E50;
    --text-secondary: #546E7A;
    --text-tertiary: #7F8C8D;
    --text-inverse: #ffffff;

    /* Border Colors - Medium Theme */
    --border-light: #BDC3C7;
    --border-medium: #95A5A6;
    --border-dark: #7F8C8D;

    /* Shadow Colors - Medium Theme */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.16);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.19);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.23);

    /* Semantic Colors */
    --success: #10b981;
    --warning: #F59E0B;
    --error: #ef4444;
    --info: #06B6D4;
}

/* =================================
   FORM COMPONENTS
   ================================= */

.form-container {
    max-width: 800px;
    margin: 40px auto;
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    letter-spacing: 0.025em;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-tertiary);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100);
    transform: translateY(-1px);
}

.form-input:hover, .form-textarea:hover {
    border-color: var(--border-medium);
}

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

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-medium);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-checkbox input[type="checkbox"]:checked {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.form-checkbox input[type="checkbox"]:hover {
    border-color: var(--primary-400);
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

/* =================================
   BUTTON COMPONENTS
   ================================= */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: var(--text-inverse);
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    box-shadow: 0 6px 20px 0 rgba(14, 165, 233, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--neutral-500), var(--neutral-600));
    color: var(--text-inverse);
    box-shadow: 0 4px 14px 0 rgba(115, 115, 115, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--neutral-600), var(--neutral-700));
    box-shadow: 0 6px 20px 0 rgba(115, 115, 115, 0.3);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--secondary-500), var(--secondary-600));
    color: var(--text-inverse);
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--secondary-600), var(--secondary-700));
    box-shadow: 0 6px 20px 0 rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-medium);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-400);
    color: var(--primary-600);
    transform: translateY(-1px);
}

/* =================================
   ALERT COMPONENTS
   ================================= */

.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg, var(--primary-50), #f0fdf4);
    border-left-color: var(--success);
    color: #065f46;
}

.alert-error {
    background: linear-gradient(135deg, var(--secondary-50), #fef2f2);
    border-left-color: var(--error);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-left-color: var(--warning);
    color: #92400e;
}

.alert::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.alert-success::before {
    background: var(--success);
}

.alert-error::before {
    background: var(--error);
}

.alert-warning::before {
    background: var(--warning);
}

/* =================================
   TAG SYSTEM COMPONENTS
   ================================= */

.tag-input-container {
    position: relative;
}

.tag-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-xl);
    margin-top: 4px;
    backdrop-filter: blur(10px);
}

.tag-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-primary);
}

.tag-dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    color: var(--primary-700);
    padding-left: 20px;
}

.tag-dropdown-item.selected {
    background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
    color: var(--primary-800);
    font-weight: 600;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-chip {
    padding: 6px 12px;
    background: var(--primary-500);
    color: var(--text-inverse);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.tag-chip:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.tag-chip .remove {
    cursor: pointer;
    font-weight: bold;
    margin-left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tag-chip .remove:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* =================================
   PAGE LAYOUT COMPONENTS
   ================================= */

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
    background: var(--bg-secondary);
    min-height: 100vh;
    position: relative;
}

.admin-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(79, 70, 229, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-light);
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px 32px;
    box-shadow: var(--shadow-md);
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.05em;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =================================
   SEARCH COMPONENTS
   ================================= */

.search-form {
    margin-bottom: 32px;
}

.search-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 15px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100);
    transform: translateY(-1px);
}

.search-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 32px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

/* =================================
   STATS COMPONENTS
   ================================= */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* =================================
   CONTAINER COMPONENTS
   ================================= */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =================================
   HEADER ACTIONS
   ================================= */

.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* =================================
   NAVIGATION COMPONENTS
   ================================= */

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--primary-600);
    background: var(--primary-50);
    transform: translateX(4px);
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */

@media (max-width: 640px) {
    .form-container {
        margin: 16px;
        padding: 24px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 24px;
    }
    
    .search-row {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .row {
        grid-template-columns: 1fr;
    }
    
    .admin-container {
        padding: 16px;
    }
}

/* =================================
   GRID LAYOUTS
   ================================= */

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* =================================
   TOPIC META COMPONENTS
   ================================= */

.topic-meta {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

/* =================================
   ENHANCED ANIMATIONS (REMOVED)
   ================================= */
