/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-color: #e1e8ed;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Навигация */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), #357abd);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

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

.nav-user {
    color: white;
    font-weight: 500;
}

.btn-logout {
    background-color: rgba(255,255,255,0.2);
}

/* Основной контент */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Форма входа */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem 0;
}

.login-card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

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

.login-header h2 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

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

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

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: #357abd;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Алерты */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background-color: #fee;
    border-left: 4px solid var(--error-color);
    color: #c33;
}

/* Дашборд */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: #666;
}

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

.repo-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.repo-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.repo-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.repo-header h3 {
    margin: 0;
}

.repo-header h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.repo-header h3 a:hover {
    text-decoration: underline;
}

.repo-visibility {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

.repo-visibility.public {
    background-color: #d4edda;
    color: #155724;
}

.repo-visibility.private {
    background-color: #f8d7da;
    color: #721c24;
}

.repo-description {
    color: #666;
    margin-bottom: 1rem;
    min-height: 3rem;
}

.repo-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.repo-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h2 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Детали репозитория */
.repo-detail-header {
    margin-bottom: 2rem;
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 1rem;
    display: inline-block;
}

.back-link:hover {
    text-decoration: underline;
}

.repo-detail-header h1 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.repo-url {
    color: #666;
    font-family: monospace;
    background: var(--bg-color);
    padding: 0.5rem;
    border-radius: 5px;
    display: inline-block;
}

.repo-info {
    margin-bottom: 2rem;
}

.info-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.info-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-card li:last-child {
    border-bottom: none;
}

.branches-section, .commits-section {
    margin-bottom: 2rem;
}

.branches-section h2, .commits-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.branches-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.branch-item {
    background: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.branch-item.default {
    background-color: #e3f2fd;
    border: 2px solid var(--primary-color);
}

.badge {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.commits-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.commit-item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.commit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.commit-header strong {
    color: var(--secondary-color);
}

.commit-sha {
    font-family: monospace;
    background: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    color: #666;
}

.commit-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

/* Инструкции */
.instructions-header {
    text-align: center;
    margin-bottom: 3rem;
}

.instructions-header h1 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.instructions-content {
    max-width: 900px;
    margin: 0 auto;
}

.instruction-section {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.instruction-section h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.code-block {
    background: #2d2d2d;
    color: #f8f8f2;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block h3 {
    color: #a6e22e;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-box {
    background: #e3f2fd;
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 5px;
    margin-top: 1rem;
}

.info-box ul {
    list-style: none;
}

.info-box li {
    padding: 0.5rem 0;
}

.info-box a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-box a:hover {
    text-decoration: underline;
}

.troubleshooting h3 {
    color: var(--error-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.troubleshooting ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.troubleshooting code {
    background: var(--bg-color);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
}

/* Футер */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
    text-align: center;
}

.footer p {
    margin: 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .repos-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
}
