:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --nav-width: 280px;
    --header-height: 70px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Common Components */
.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
}


/* Common Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--background-color);
    border-color: var(--text-secondary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Login Page with Glassmorphism */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 60%);
    top: -25%;
    left: -25%;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 400px;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.input-icon input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
    outline: none;
}

.input-icon input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.alert {
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Layout */
.top-bar {
    height: var(--header-height);
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo-area i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.main-content {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding: 2rem;
}

/* Repo Selection */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
}

.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.repo-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.repo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.repo-icon {
    width: 64px;
    height: 64px;
    background-color: #e0e7ff;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    transition: background-color 0.3s;
}

.repo-card:hover .repo-icon {
    background-color: var(--primary-color);
    color: white;
}

.repo-info h3 {
    color: var(--text-primary);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.action-text {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
}

.repo-card:hover .action-text {
    opacity: 1;
    transform: translateY(0);
}

/* Viewer Layout */
.viewer-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.viewer-container {
    display: flex;
    flex: 1;
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

.left-nav {
    width: var(--nav-width);
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #f8fafc;
}

.file-list {
    list-style: none;
    padding: 0.5rem;
}

.file-item {
    margin-bottom: 0.25rem;
}

.file-item a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.file-item a:hover {
    background-color: #f1f5f9;
}

.file-item.active a {
    background-color: #e0e7ff;
    color: var(--primary-color);
    font-weight: 500;
}

.file-item i {
    margin-right: 0.75rem;
    color: var(--text-secondary);
    width: 16px;
    text-align: center;
}

.file-item.active i {
    color: var(--primary-color);
}

.right-panel {
    flex: 1;
    background-color: #f1f5f9;
    /* Neutral gray */
    position: relative;
    overflow: hidden;
}

.empty-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.empty-viewer i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.report-frame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

.separator {
    color: var(--text-secondary);
    margin: 0 0.5rem;
}

.current-repo {
    font-weight: 400;
    color: var(--text-secondary);
}

.back-link {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--primary-color);
}

/* Admin Features */
.section-header {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    background-color: #f1f5f9;
    letter-spacing: 0.05em;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 0.5rem;
}

.file-item a {
    flex: 1;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
}

.file-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background-color: #fee2e2;
}

.deleted-item a {
    color: var(--text-secondary);
    text-decoration: line-through;
}