/* css/repo-style.css */

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #7C3AED;
    --bg-main-light: #F8FAFC;
    --bg-main-dark: #0F172A;
    --card-light: rgba(255, 255, 255, 0.9);
    --card-dark: rgba(30, 41, 59, 0.9);
    --text-light: #0F172A;
    --text-dark: #F8FAFC;
    --text-muted: #64748B;
    --border-light: rgba(226, 232, 240, 0.9);
    --border-dark: rgba(51, 65, 85, 0.9);
    --radius: 14px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

html.light {
    --bg-main: var(--bg-main-light);
    --text-color: var(--text-light);
    --card-bg: var(--card-light);
    --border-color: var(--border-light);
}

html.dark {
    --bg-main: var(--bg-main-dark);
    --text-color: var(--text-dark);
    --card-bg: var(--card-dark);
    --border-color: var(--border-dark);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

.hidden { display: none !important; }
.required-star { color: #EF4444; margin-left: 2px; }

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Form Control Base Styles */
.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-color);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 85px;
    line-height: 1.5;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%20%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

/* App Layout */
.repo-app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.repo-sidebar {
    width: 260px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.repo-sidebar.collapsed { width: 80px; }
.repo-sidebar.collapsed span, .repo-sidebar.collapsed .sidebar-footer span { display: none; }

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--text-color);
}

.sidebar-menu ul { list-style: none; }
.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}

.sidebar-menu li.active a, .sidebar-menu li a:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Main Layout Wrapper */
.repo-main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
.repo-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-box {
    position: relative;
    width: 380px;
}

.search-box .form-control {
    padding-left: 40px;
    border-radius: 20px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-right { display: flex; align-items: center; gap: 15px; }

/* Buttons */
.btn {
    padding: 9px 20px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-sm { padding: 7px 16px; font-size: 0.85rem; }
.btn-primary { background: var(--primary); color: #FFF; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: transparent; border: 1px solid var(--border-color); color: var(--text-color); }

.btn-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }

/* Content Body */
.content-body { padding: 30px; }

/* Dashboard Stats Grid */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label { font-size: 0.85rem; color: var(--text-muted); }
.stat-card h3 { font-size: 1.8rem; font-weight: 700; margin-top: 5px; }
.stat-icon { font-size: 2.2rem; color: var(--primary); opacity: 0.9; }

/* Filter Controls Bar */
.filter-controls-bar {
    padding: 16px 20px;
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    gap: 15px;
    max-width: 450px;
}

/* Repo Cards Grid */
.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.repo-card {
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.repo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.badge-public { background: rgba(34, 197, 94, 0.15); color: #22C55E; padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.badge-private { background: rgba(239, 68, 68, 0.15); color: #EF4444; padding: 2px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }

/* Drag & Drop Upload Zone */
.drag-drop-zone {
    display: block;
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 35px 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(79, 70, 229, 0.03);
    margin-top: 10px;
    transition: all 0.2s ease;
    user-select: none;
}

.drag-drop-zone:hover {
    background: rgba(79, 70, 229, 0.08);
    border-color: var(--primary-hover);
}

.drop-icon {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 10px;
    pointer-events: none;
}

.drag-drop-zone p, .drag-drop-zone span {
    pointer-events: none;
}

.file-hint { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.file-input-hidden { display: none !important; }

/* Modal Box Styling */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.96) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-dialog {
    width: 100%;
    max-width: 520px;
    padding: 28px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--text-color);
    background: rgba(100, 116, 139, 0.1);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn {
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 0.9rem;
}

/* Progress Bar */
.progress-bar-bg { width: 100%; height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; margin-top: 15px; }
.progress-bar-fill { height: 100%; width: 0%; background: var(--primary); transition: width 0.2s; }
.progress-text { font-size: 0.8rem; color: var(--text-muted); display: block; margin-top: 5px; }

/* Toast Notifications */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--card-bg); border-left: 4px solid var(--primary); padding: 12px 20px; border-radius: 8px; box-shadow: var(--shadow); color: var(--text-color); font-size: 0.9rem; }