* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: auto;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: #000000;
    overflow-x: hidden;
    overflow-y: auto;
}

.folder-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.homepage-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 40px;
}

.folders-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 120px);
    display: flex;
    align-items: stretch;
}

.names-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 40px 60px;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-items: center;
}

.name-item {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: #000000;
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-align: center;
    user-select: none;
}

.name-item:hover {
    opacity: 0.5;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1000;
    pointer-events: none;
}

.modal-overlay.active {
    pointer-events: auto;
}

.modal-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #ffffff;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    z-index: 1001;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 13px;
    right: 13px;
    width: auto;
    height: auto;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    z-index: 1002;
    padding: 0;
}

.modal-close:hover {
    opacity: 0.5;
}

.modal-close .close-icon {
    width: auto;
    height: auto;
    max-width: 60px;
    max-height: 60px;
    display: block;
}

.modal-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-content .business-card {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    position: relative;
    display: block;
}

/* Override template styles for modal card display */
.modal-content .business-card .container {
    height: 100vh !important;
    width: 100vw !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content .business-card .main-content {
    height: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 968px) {
    .homepage-container {
        padding: 40px 20px;
    }

    .names-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(5, 1fr);
        gap: 30px 40px;
    }

    .modal-content .business-card {
        height: 100vh;
    }
}

@media (max-width: 640px) {
    .homepage-container {
        padding: 30px 15px;
    }

    .names-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(8, 1fr);
        gap: 25px 30px;
    }

    .name-item {
        font-size: 0.9rem;
    }

    .modal-overlay {
        padding: 10px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

