/* ---- Demo Grid Layout ---- */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive grid */
    gap: 15px;
}

/* ---- Demo Tile Styling ---- */
.demo-tile {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 10px;
    background: #202124;
    transition: transform 0.2s ease-in-out;
}

.demo-tile:hover {
    transform: scale(1.05);
}

/* ---- Demo Title Banner ---- */
.demo-title-banner {
	height: 70px;
    background: #FFC223;
    color: #202124;
    padding: 5px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
	display: flex;
    justify-content: center;
    align-items: center;
}

.demo-title-banner a {
    color: #202124 !important;
}

.demo-tags {
    margin-top: 5px;
}

.demo-tag {
    display: inline-block;
    background: #FFC223;
    color: #202124;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 15px;
    font-size: 8px;
    margin: 3px;
}

/* ---- Embedded Media Responsiveness ---- */
.demo-media iframe {
    width: 100%;
}

/* ---- Filters ---- */
.demo-filter-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Each Filter Dropdown */
.tag-filter {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    width: 200px;
    text-align: center;
}

/* Style on Hover */
.tag-filter:hover {
    border-color: #0073aa;
}

/* Style on Selection */
.tag-filter:focus {
    outline: none;
    border-color: #005177;
    box-shadow: 0px 0px 5px rgba(0, 115, 170, 0.5);
}

/* ---- Responsive Modal Styling ---- */
.demo-modal {
    display: none; /* Keeps modal hidden until triggered */
    position: fixed;
    z-index: 1050;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 80vh; 
    width: 90vw;
    max-width: 900px;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    flex-direction: column;
}

/* ---- Modal Content ---- */
.demo-modal-content {
    flex-grow: 1;
    overflow-y: auto; /* Enable scrolling */
    max-height: calc(80vh - 60px); /* Adjust modal content height */
}

/* ---- Modal Layout (Desktop) ---- */
.modal-columns {
    display: flex;
    gap: 20px;
    flex-grow: 1; /* Allows content to expand dynamically */
    overflow: hidden;
}

.modal-left {
    flex: 2;
    max-height: calc(80vh - 60px); /* Ensures it doesn't exceed modal height */
    overflow-y: auto;
    padding-right: 15px;
}

.modal-right {
    flex: 1;
    padding-left: 15px;
    border-left: 2px solid #ccc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    max-height: calc(80vh - 60px); /* Keeps it within modal */
}

/* ---- Scrollbar Customization ---- */
.modal-left::-webkit-scrollbar {
    width: 8px;
}

.modal-left::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 5px;
}

.modal-left::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* ---- Close Button ---- */
.close {
    float: right;
    font-size: 28px;
    cursor: pointer;
}

/* ---- Contact Form Layout ---- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---- Mobile Responsiveness ---- */
@media (min-width: 900px) {
    .demo-grid {
        grid-template-columns: repeat(3, 1fr); /* Ensures max of 3 columns */
    }
}

@media (max-width: 768px) {
    /* Adjust filter dropdowns */
    .demo-filter-container {
        flex-direction: column;
        align-items: center;
    }

    .tag-filter {
        width: 90%;
    }

    /* Stack modal layout into one column for smaller screens */
    .modal-columns {
        flex-direction: column;
        gap: 10px;
    }

    .modal-left, .modal-right {
        flex: unset;
        max-height: unset;
        width: 100%;
    }

    .modal-right {
        border-left: none;
        border-top: 2px solid #ccc;
        padding-top: 10px;
    }

    /* Improve modal responsiveness */
    .demo-modal {
        width: 95vw;
        height: 75vh;
        max-width: 95%;
        padding: 15px;
    }
}
