/*
 * ESTRO MedPhys Main Stylesheet
 * This stylesheet contains all the core styling for the ESTRO MedPhys application
 */

/* ==========================================================================
   Base Layout Styles
   Sets up the fundamental page structure and typography
   ========================================================================== */
   body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    font-family: Arial;
    font-size: 16px;
    color: #24292e;
    overflow-y: auto;
}

/* Modern scrollbar styling for all browsers */
* {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* WebKit browsers (Chrome, Safari, etc.) */
*::-webkit-scrollbar {
    width: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

main {
    flex: 1;
    padding: 0 1rem;
}

/* ==========================================================================
   Project Management Interface
   Styles for project listing, adding, and management controls
   ========================================================================== */
.add-project-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    margin-right: 1%;
}

.status-message {
    color: red;
    margin-right: 20px;
    flex-grow: 1;
}

#addProjectButton {
    font-size: 14px;
    padding: 10px 20px;
    background-color: #FC814A;
    color: #01172F;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

#addProjectButton:hover {
    background-color: #cc6639;
}

/* ==========================================================================
   Modal System
   Styles for overlay popups and form interfaces
   ========================================================================== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
}

.popup h2, .popup h3 {
    margin-top: 25px;
    margin-bottom: 25px;
}

.popup h3:first-child {
    margin-top: 0;
}

.popup input, .popup textarea, .popup select {
    width: 100%;
    padding: 8px;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.popup textarea {
    font-family: inherit;
    height: 100px;
    resize: vertical;
}

.popup select[multiple] {
    height: 120px;
}

#submitRepo {
    padding: 10px 20px;
    background-color: #FC814A;
    color: #01172F;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    float: right;
    margin-top: 20px;
}

#submitRepo:hover {
    background-color: #cc6639;
}

#repoStatus {
    clear: both;
    margin-top: 20px;
    font-weight: bold;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 24px;
}

/* ==========================================================================
   Error Handling and Validation
   Styles for error states and validation feedback
   ========================================================================== */
.overlay-error {
    display: none;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
}

.overlay-error.show {
    display: block;
}

.error-field {
    border: 2px solid #721c24 !important;
    background-color: #fff0f0;
    transition: all 0.3s ease;
}

.error-message {
    color: #721c24;
    font-size: 0.8em;
    margin-bottom: 2px;
    position: absolute;
    right: 0;
    top: -10px;
}

.popup input, .popup textarea, .popup select {
    position: relative;
    margin-top: 10px;  /* Add space above for error message */
}

.popup .input-wrapper {
    position: relative;
    width: 100%;
    margin-top: 10px;
}

.back-button {
    font-size: 14px;
    padding: 10px 20px;
    background-color: #FC814A;
    color: #01172F;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-button:hover {
    background-color: #cc6639;
}

#project-details {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

#project-details .project-header {
    display: flex;
    flex-direction: column;
    text-align: center;
    margin-bottom: 15px;
}

#project-details .project-title {
    flex-grow: 1;
}

#project-details .info-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f6f8fa;
    border-radius: 6px;
}

#project-details .tag {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    background-color: #e1e4e8;
    border-radius: 4px;
}

#project-details .indicator {
    margin-right: 15px;
}

#project-details .indicator.active {
    color: #2ea44f;
}

#project-details .indicator.inactive {
    color: #586069;
    opacity: 0.5;
}


.remove-project-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.remove-project-button:hover {
    background-color: #c82333;
}

.project-actions-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.edit-project-button {
    background-color: #0366d6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-project-button:hover {
    background-color: #0256b4;
}

/* ==========================================================================
   Footer Styling
   Styles for the site footer and related elements
   ========================================================================== */
.site-footer {
    background-color: #f8f9fa;
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #ddd;
}

.footer-content a {
    color: #01172F;
    text-decoration: none;
}

.footer-content a:hover {
    color: #FC814A;
}

.project-details-logo {
    height: 200px;
    width: auto;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    padding: 1rem;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow added */
}

.project-details-logo img {
    max-height: 100%;
    width: auto; /* Allow width to adjust naturally */
    object-fit: contain;
    border-radius: 8px;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.required-star {
    position: relative;
}

.popup input:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
    color: #666;
    border: 1px solid #ddd;
}

.progress-bar {
    width: 300px;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px auto;
}

.progress {
    width: 0%;
    height: 100%;
    background-color: #FC814A;
    transition: width 0.5s ease-in-out;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    width: 100%;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.loading-text {
    color: #666;
    font-size: 1.1em;
    text-align: center;
    margin-bottom: 10px;
}

.loading-curtain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

.skeleton-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1rem;
    flex-basis: 23%;
    margin: 1%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    position: relative;
    padding-bottom: 3.5rem;
    height: 450px;
}

.skeleton-logo {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;  /* Maintains square shape */
    border-radius: 12px;
    margin-bottom: 1rem;
}

.skeleton-title {
    width: 80%;
    height: 24px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-description {
    width: 90%;
    height: 60px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-indicators {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    gap: 0.5rem;
}

.skeleton-indicator {
    width: 80px;
    height: 20px;
    border-radius: 4px;
}

.skeleton-github-link {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 100px;
    height: 20px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .skeleton-card {
        flex-basis: calc(50% - 1rem);
        margin: 0.5rem;
    }
}

@media (max-width: 480px) {
    .skeleton-card {
        flex-basis: 100%;
        margin: 0.5rem 0;
    }
}

.input-wrapper {
    margin-bottom: 10px;
}

.input-wrapper label {
    display: block;
    /* margin-bottom: 0; */
    font-weight: 500;
}

.input-container {
    display: flex;
    flex-direction: column;
}

/* Platform Selector Styles */
.platform-selector {
    text-align: center;
    max-width: 400px !important;
}

.platform-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.platform-btn {
    padding: 15px 20px;
    font-size: 16px;
    background-color: #FC814A;
    color: #01172F;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.platform-btn:hover {
    background-color: #cc6639;
}

.platform-btn i {
    font-size: 20px;
}

/* Styles for the info icon (i) that appears next to form fields
   Used to provide additional context and help text to users */

.info-icon {
    color: #63768D;

    margin-left: 5px;
    cursor: help;
    font-size: 14px;
}

.info-icon:hover {
    color: #4a5a6d;
}

/* Style for the tooltip that appears on hover */
[title] {
    position: relative;
    cursor: help;
}

[title]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}