:root {
    --primary-bg: #1e1e1e;
    --secondary-bg: #2a2a2a;
    --card-bg: #333;
    --text-color: #e0e0e0;
    --link-color: #8aff8a;
    --border-color: #444;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --error-color: #ff6666;
    --warning-color: #ffcc00;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--primary-bg);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    min-height: 100vh;
}

#app {
    display: flex;
    width: 90%; /* Adjust as needed */
    max-width: 1400px; /* Max width for the app container */
    margin: 20px;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden; /* Ensures border-radius applies to children */
}

#user-info-sidebar {
    width: 280px;
    padding: 25px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0; /* Prevent sidebar from shrinking */
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 20px;
}

#user-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--link-color);
    box-shadow: 0 0 15px rgba(138, 255, 138, 0.4);
    transition: transform 0.3s ease-in-out;
}

#user-avatar:hover {
    transform: scale(1.05);
}

#user-name {
    margin: 0 0 10px;
    color: var(--link-color);
}

#configure-btn {
    background-color: var(--link-color);
    color: var(--primary-bg);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

#configure-btn:hover {
    background-color: #6edb6e;
}

#user-details p, #custom-info p {
    font-size: 0.95em;
    margin-bottom: 8px;
}

#user-details a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

#user-details a:hover {
    text-decoration: underline;
    color: #aaffaa;
}

#custom-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

#custom-info h3 {
    margin-top: 0;
    color: var(--link-color);
}

#repo-grid-container {
    flex-grow: 1; /* Allows main content to take remaining space */
    padding: 25px;
    overflow-y: auto; /* Enable scrolling for repos if they exceed height */
}

#main-title {
    text-align: center;
    color: var(--link-color);
    margin-bottom: 30px;
}

#repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.repo-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px var(--shadow-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.repo-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--link-color);
    font-size: 1.3em;
}

.repo-card h3 a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.repo-card h3 a:hover {
    color: #aaffaa;
    text-decoration: underline;
}

.repo-card p {
    margin: 5px 0;
    font-size: 0.9em;
}

.repo-card .meta-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #bbb;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.repo-card .meta-info span {
    display: flex;
    align-items: center;
}

.repo-card .meta-info span svg {
    margin-right: 5px;
    width: 16px;
    height: 16px;
    fill: #bbb;
}

.message {
    padding: 20px;
    text-align: center;
    font-size: 1.1em;
    background-color: var(--card-bg);
    border-radius: 8px;
    margin-top: 20px;
}

.message.hidden {
    display: none;
}

#error-message {
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

#loading-message {
    color: var(--link-color);
    border: 1px solid var(--link-color);
}

#no-repos-message {
    color: #bbb;
    border: 1px solid #bbb;
}

.hidden {
    display: none !important;
}

/* Modal Styling */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--secondary-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
    width: 90%;
    max-width: 500px;
    text-align: center;
}

.modal-content h2 {
    color: var(--link-color);
    margin-top: 0;
    margin-bottom: 20px;
}

.modal-content p {
    margin-bottom: 15px;
    font-size: 0.95em;
    color: #ccc;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-color);
}

.form-group input {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1em;
}

.warning-text {
    color: var(--warning-color);
    font-size: 0.85em;
    margin-top: 5px;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

#clear-cache-btn {
    background-color: var(--error-color);
    color: var(--primary-bg);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#clear-cache-btn:hover {
    background-color: #d64f4f;
}

.modal-buttons button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

#save-config-btn {
    background-color: var(--link-color);
    color: var(--primary-bg);
}

#save-config-btn:hover {
    background-color: #6edb6e;
    transform: translateY(-1px);
}

#cancel-config-btn {
    background-color: var(--border-color);
    color: var(--text-color);
}

#cancel-config-btn:hover {
    background-color: #555;
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    #app {
        flex-direction: column;
        width: 100%;
        margin: 0;
        border-radius: 0;
    }

    #user-info-sidebar {
        width: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 20px;
    }

    #repo-grid-container {
        padding: 20px 15px;
    }

    #repo-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 600px) {
    .modal-content {
        padding: 20px;
    }
    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .modal-buttons button {
        width: 100%;
    }
}
