:root {
    --primary-color: #f05032;
    --primary-dark: #d93e23;
    --secondary-color: #362f2d;
    --accent-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --sidebar-width: 260px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Page */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.git-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    color: white;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.login-header p {
    font-size: 14px;
    opacity: 0.9;
}

.login-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-input,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus,
input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 80, 50, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #2a2422;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--accent-color);
    color: white;
}

.btn-success:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 10px;
    background: transparent;
    border: 2px solid var(--border-color);
}

.btn-icon:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-group .btn {
    flex: 1;
}

.error-message {
    background: #ffebee;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    border-left: 4px solid var(--danger-color);
}

.login-footer {
    padding: 20px 30px;
    background: var(--bg-color);
    text-align: center;
}

.hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Main App Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary-color);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    text-align: center;
}

.sidebar-header .git-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(240, 80, 50, 0.2);
    color: white;
    border-left: 4px solid var(--primary-color);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.logout-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.logout-link:hover {
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.content-header {
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.content-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Browser */
.browser-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.path-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.path-label {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.path-input {
    flex: 1;
    background: var(--bg-color);
}

.file-list {
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.file-item:hover {
    background: var(--bg-color);
}

.file-item svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.file-item.folder svg {
    color: var(--warning-color);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
    opacity: 0.4;
}

.quick-folders {
    margin-top: 25px;
}

.quick-folders h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.folder-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.folder-chip {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.folder-chip:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Operations */
.repo-info {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

/* Quick Workflow */
.quick-workflow {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-hover);
}

.quick-workflow h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.workflow-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.workflow-step {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.step-number {
    background: white;
    color: #667eea;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.step-text {
    font-weight: 500;
}

.workflow-arrow {
    font-size: 24px;
    font-weight: bold;
}

.quick-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.quick-actions .form-input {
    background: rgba(255, 255, 255, 0.9);
    border: none;
}

.quick-actions .btn {
    white-space: nowrap;
    background: white;
    color: #667eea;
    font-weight: 700;
}

.quick-actions .btn:hover {
    background: #f0f0f0;
    color: #764ba2;
}

.info-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: var(--text-primary);
}

.info-value {
    color: var(--text-secondary);
}

.status-git {
    color: var(--accent-color) !important;
    font-weight: 600;
}

.status-no-git {
    color: var(--warning-color) !important;
    font-weight: 600;
}

.repo-warning {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 14px;
    border-left: 4px solid var(--warning-color);
}

.repo-locked {
    background: #ffebee;
    color: #c62828;
    border-left-color: var(--danger-color);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.branch-info {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.branch-info .info-value {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}

/* Quick Config */
.quick-config {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-hover);
}

.quick-config h3 {
    margin-bottom: 10px;
    font-size: 24px;
}

.config-description {
    opacity: 0.9;
    margin-bottom: 10px;
}

.config-note {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    border-left: 3px solid white;
}

.config-form {
    background: rgba(255, 255, 255, 0.15);
    padding: 25px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.repo-preview {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 5px 10px;
    margin-bottom: 8px;
}

.repo-base {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.repo-input {
    border: none !important;
    background: transparent !important;
    padding: 8px !important;
    font-weight: 600;
    color: var(--primary-color) !important;
    flex: 1;
}

.form-hint {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    display: block;
}

.btn-large {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
}

.config-status {
    margin-top: 20px;
}

.success-message {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid white;
}

/* Auto Info */
.auto-info {
    background: #e3f2fd;
    color: #1565c0;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    text-align: center;
    border-left: 4px solid #1565c0;
}

/* Advanced Options */
.advanced-options {
    margin-top: 15px;
    cursor: pointer;
}

.advanced-options summary {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 8px;
    text-align: center;
    user-select: none;
}

.advanced-options summary:hover {
    color: var(--primary-color);
}

.operations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.operation-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.operation-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.card-header {
    background: var(--bg-color);
    padding: 15px 20px;
    border-bottom: 2px solid var(--border-color);
}

.card-header h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 0;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 5px 0 0 0;
    font-weight: normal;
}

.card-body {
    padding: 20px;
}

.card-body .form-input,
.card-body input {
    margin-bottom: 10px;
}

.input-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-with-button {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.input-with-button .form-input {
    flex: 1;
    margin-bottom: 0;
}

.input-with-button .btn-icon {
    padding: 10px;
}

.card-body .btn-block:last-child {
    margin-bottom: 0;
}

.output-section {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--secondary-color);
    color: white;
}

.output-header h3 {
    font-size: 16px;
}

.command-output {
    padding: 20px;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    min-height: 200px;
    max-height: 400px;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Config View */
.config-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* Clone View */
.clone-container {
    max-width: 700px;
}

.form-hint-dark {
    color: var(--text-secondary);
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

.path-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.path-input-group .form-input {
    flex: 1;
}

.clone-examples {
    background: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid var(--primary-color);
}

.clone-examples strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.example-paths {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.example-paths code {
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--border-color);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--text-primary);
}

.example-paths code:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

/* Info Box */
.info-box {
    background: #fff3e0;
    border-left: 4px solid var(--warning-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.info-box strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 8px;
}

.info-box p {
    margin: 5px 0;
    color: var(--text-secondary);
}

.info-box ul, .info-box ol {
    margin: 8px 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.info-box li {
    margin: 4px 0;
}

/* Workflow Info */
.workflow-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.workflow-info h3 {
    margin-bottom: 20px;
    font-size: 24px;
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.workflow-option {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.option-icon {
    font-size: 48px;
    margin-bottom: 15px;
    text-align: center;
}

.workflow-option h4 {
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
}

.workflow-option p {
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.workflow-option ul {
    list-style: none;
    padding: 0;
}

.workflow-option li {
    padding: 8px 0 8px 25px;
    position: relative;
    font-size: 14px;
}

.workflow-option li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--card-bg);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid var(--accent-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast svg {
    width: 20px;
    height: 20px;
}

.toast.success svg {
    color: var(--accent-color);
}

.toast.error svg {
    color: var(--danger-color);
}

.toast.warning svg {
    color: var(--warning-color);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

    .operations-grid {
        grid-template-columns: 1fr;
    }

    .config-container {
        grid-template-columns: 1fr;
    }
}
