body {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
    background-image: url('../images/chat_background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-wrap: nowrap;
}

.header-logo {
    width: 60px;
    align-self: flex-start;
}

.university-logo {
    height: 40px;
    flex-shrink: 0;   
}

.header-text {
    text-align: center;
    flex-grow: 1;
}

h1, h2, h3, h4 {
    margin: 10px 0;
}

h2 {
    font-size: 16px;
    color: #333;
    margin-top: 50px;
    margin-bottom: 5px;
}

h1 {
    font-size: 22px;
    margin: 5px 0;
}

h3 {
    font-size: 14px;
    margin: 15px 0;
}

#chat-wrapper {
    width: 70%; 
    height: 72vh;         
    max-height: 74vh;
    margin: 1px auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    background-color: rgba(255, 255, 255, 0.9); /*#f0f0f0;*/
    
}

.chatwindow-input {
    width: 50%;
    background-color: #e0f7fa;
    padding: 10px;
    display: flex;
    align-items: center; /* 세로 중앙 정렬 */
    justify-content: center; /* 가로 중앙 정렬 */
    margin: 1px auto; /* 중앙에 정렬 */
    margin-bottom: 10px;
    border-radius: 10px;
}

.chatwindow-input span {
    font-weight: 600; /* 100부터 900까지 값으로 굵기를 조절할 수 있습니다. */    
}

.chatwindow-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
}

.chat-content {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
}

.chatwindow-info {
    background-color: white;
    padding: 10px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.chatwindow-info span {
    font-weight: 600;
}

.chatwindow-logo {    
    width: 60px;
    align-self: flex-start;    
    margin-right: 20px;
}



#chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    margin: 2px auto;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    width: 98%;
    height: calc(70vh - 50px); /*; 채팅 입력 필드와 버튼을 위한 공간을 고려하여 조정 */
    display: flex;
    flex-direction: column;
}


.message {
    display: flex;
    margin-bottom: 10px;
}

.ai-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-wrapper {
    display: flex;
    align-items: center;
    max-width: 80%;
}

.message-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 10px;
    margin: 0 10px;
    font-size: 1rem; 
}

.user-message .message-content {
    background-color: #e6f2ff;
}

.message-content h1, .message-content h2, .message-content h3 {
    margin-top: 10px;
    margin-bottom: 5px;
}

.message-content ul, .message-content ol {
    margin-left: 20px;
}

.message-content p {
    margin: 0 0 10px 0;
}

.input-container {
    position: relative;
    width: 70%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background-image: url('../images/chat_background.jpg');
    background-size: cover;
    background-position: center;
    padding: 3px;
    border-radius: 25px;
}

#user-input {
    width: 100%;
    height: 40px;
    padding: 10px 40px 10px 15px;
    font-size: 16px;
    border: 1px solid rgba(204, 204, 204, 0.5);
    border-radius: 25px;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.8);
}

#send-button {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #007bff;
    transition: color 0.3s ease;
    border-radius: 50%;
}

#send-button:hover {
    color: #0056b3;
}

.send-icon {
    font-size: 24px;
    color: #007bff;
}

.button-container {
    width: 100%;
    margin: 10px auto;
    display: flex;
    justify-content: center;
    padding: 10px;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    flex-wrap: nowrap;
}

.button-container button {
    margin: 0 5px;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.8);
    transition: background-color 0.3s ease;
    border: 1px solid rgba(204, 204, 204, 0.5);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
}

.button-container button:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: rgba(255, 255, 255, 0.9);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    text-align: center;
    position: relative;
    background-image: url('../images/chat_background.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-content .university-logo {
    position: absolute;
    bottom: 10px;
    right: 10px;
    height: 40px;
}

.header-logo {
    width: 60px;
    position: absolute;
    top: 10px;
    left: 10px;
}


.expo-title-en {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.2;
}

.expo-title-kr {
    font-size: 20px;
    margin: 5px 0;
    line-height: 1.2;
}

.program-title {
    font-size: 16px;
    margin: 5px 0 0 0;
    line-height: 1.2;
}


.summary-container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.summary-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.summary-content {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
}

.main-issue {
    font-size: 18px;
    color: #007bff;
    margin-bottom: 15px;
}

.advice {
    background-color: #f8f9fa;
    padding: 10px;
    border-left: 4px solid #007bff;
    margin: 15px 0;
}

.meditation {
    margin: 15px 0;
}

.meditation h3 {
    color: #28a745;
    margin-bottom: 5px;
}

.date-time {
    text-align: right;
    color: #6c757d;
    font-size: 14px;
    margin-top: 20px;
}


#summaryContent {
    line-height: 1.6;
    padding: 10px;
    font-family: Arial, sans-serif;
}

#summaryContent h1, #summaryContent h2, #summaryContent h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

#summaryContent p {
    margin-bottom: 10px;
}

#summary-text { 
    text-align: left;   
    margin-bottom: 20px; 
}

.summary-section {
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 15px;
}

.summary-section h3 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.counselor-info {
    display: flex;
    justify-content: space-between;
    background-color: #e8f4f8;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.counselor-info span {
    font-weight: bold;
}

.main-issue {
    font-weight: bold;
    color: #e74c3c;
}

.emotional-state {
    font-style: italic;
    color: #7f8c8d;
}

.advice, .meditation-description {
    background-color: #ecf0f1;
    border-left: 4px solid #3498db;
    padding: 10px;
    margin-top: 10px;
}

.close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.email-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

#userEmail {
    width: 80%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}


.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.hidden {
    display: none;
}

#consent-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

#consent-modal .modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    max-width: 500px;
    border-radius: 5px;
    text-align: left;  /* 본문 텍스트 왼쪽 정렬 */
    position: relative;  /* 로고 배치를 위한 상대 위치 설정 */
    padding: 40px 20px;
}

#consent-modal h1 {
    text-align: center;  /* "상담을 시작하기 전에" 텍스트 중앙 정렬 */
    margin-bottom: 20px;  /* 제목 아래 여백 추가 */
}

#consent-modal .header-logo {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 60px;
}


#consent-modal .university-logo {
    position: absolute;
    bottom: 10px;
    right: 10px;
    height: 40px;
}

#consent-text { 
    text-align: left;   
    margin-bottom: 20px; 
}

#consent-form {
    display: flex;
    flex-direction: column;    
}

#consent-form .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

#consent-form label {
    width: 120px;
    text-align: right;
    margin-right: 10px;
}

#consent-form select,
#consent-form input[type="text"] {
    flex: 1;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

#consent-form .checkbox-group {
    margin-left: 130px;
}

#consent-form .checkbox-group label {
    width: auto;
    text-align: left;
}

#consent-form .button-container {
    display: flex;
    justify-content: center;  /* 버튼 중앙 정렬 */
    width: 100%; 
    margin-top: 20px;
    margin-bottom: 20px;  /* 하단 로고와 겹치지 않도록 여백 추가 */
}


#consent-form .submit-btn {
    margin: 0 5px;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.8);
    transition: background-color 0.3s ease;
    border: 1px solid rgba(204, 204, 204, 0.5);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    color: #333; /* 텍스트 색상 추가 */
}

#consent-form .submit-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

#consent-form button:hover {
    background-color: #45a049;
}

.pre-wrap {
    white-space: pre-wrap;
}


#programContent {
    text-align: left;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 8px;
    height:auto;
    padding-top: 0;
}

.program-entry {
    margin-bottom: 5px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

#sayingContent {
    align-items: center;
    text-align: center;
    margin: 20px 0;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 8px;
}

/* .sayingContent-input {
    width: 50%;
    background-color: #e0f7fa;
    padding: 5px;
    display: flex;
    align-items: center; 
    justify-content: center; 
    margin: 1px auto; 
    margin-top: 10px;
    margin-bottom: 0px;
    border-radius: 10px;
}

.sayingContent-input img {
    width: 30px;
    height: 30px;
} */

.saying-quote {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;    
    white-space: pre-line;        /* 개행 문자 표시 */ 
}

.saying-author, .saying-explanation {
    display: flex;                  /* Flexbox 레이아웃을 사용하여 정렬 */
    justify-content: center;        /* 가로 방향 중앙 정렬 */
    align-items: center;            /* 세로 방향 중앙 정렬 */
    text-align: center;             /* 텍스트를 중앙 정렬 */
    height: 100%;                   /* 높이를 전체로 설정하여 수직 중앙 정렬 */
    width: 100%;                    /* 가로 너비를 전체로 설정하여 중앙 정렬 효과 */
    padding: 0px;                  /* 원하는 만큼 패딩을 추가 */
    font-size: 16px;               /* 텍스트 크기를 조절 */    
}


.saying-container {
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    align-items: center;
}

.program-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0px;
    margin-bottom: 40px;
}

.counselor-icon {
    width: 50px;
    height: 50px;
    margin-right: 15px;
}

@media print {
    /* 불필요한 요소 숨기기 */
    .button-container, .close {
        display: none !important;
    }

    .university-logo {
        display: block !important;
        bottom: 0px;
        right: 10px;
        height: 20px;        
    }
    

    /* 전체 글자 크기 조정 및 스타일 통일 */
    body {
        font-size: 14pt !important;
        line-height: 1.5 !important;
        color: black !important;
    }

    /* 특정 요소의 글자 크기 조정 */
    #programModal h1 {
        font-size: 20px !important; /* 제목 글자 크기 */
        font-weight: bold !important;  /* 가독성을 위한 굵기 */
        margin-bottom: 0 !important;
        margin-top: 0 !important;
    }

    #programModal h4 {
        font-size: 14px !important; /* 제목 글자 크기 */
        margin-bottom: 5px !important;
        margin-top: 0 !important;
    }

    #programModal p {
        font-size: 14px !important; /* 본문 글자 크기 */
        margin-bottom: 5px !important; /* 단락 사이 간격 */
    }

    /* programModal 스타일 */
    #programModal {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        background-image: url('../images/chat_background.jpg') !important;
        background-size:cover !important;
        background-position: center !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        margin-bottom: 5mm !important;
    }



    /* 배경 이미지 위에 내용을 보이게 하기 위한 설정 */
    #programModal::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.9) !important;
        z-index: -1;
    }

    /* 프린트 시 모든 내용이 보이도록 설정 */
    #programModal, #programModal * {
        visibility: visible !important;
    }

    /* 프로그램 헤더 스타일 */
    #programHeader {
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }

    /* 프로그램 내용 스타일 */
    #programContent {
        background-color: transparent !important;
        color: black !important;
        padding: 0 !important;
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        font-size: 13px !important; /* 본문 글자 크기 */            
    }

    /* 프로그램 내용 스타일 */
    #sayingContent {
        padding: 5 !important;        
        font-size: 13px !important; /* 본문 글자 크기 */     
        margin-bottom: 5px !important;
        margin-top: 0 !important;
    }
}



/* programModal용 페이지 설정 */
@page programModal {
    size: A5;
    margin: 5mm;
}



@media print {
    @page {
        size: A5;
        margin: 0;
    }

    body.printing-summary {
        background: none !important;
    }

    body.printing-summary > *:not(#summaryModal) {
        display: none !important;
    }

    body.printing-summary #summaryModal {
        display: block !important;
        position: relative !important;
        width: 100% !important; /* A5 width */
        height: 100% !important; /* A5 height */
        padding: 5mm !important;        
        box-sizing: border-box !important;
        overflow: hidden !important;
        background-image: url('../images/chat_background.jpg') !important;
        background-size: cover !important;
        background-position: center !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        margin-bottom: 5mm !important;
    }

    body.printing-summary #summaryModal::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.9) !important;
        z-index: -1;
        overflow: visible !important; /* 필요하다면 overflow 설정을 visible로 변경 */
    }

    body.printing-summary #summaryModal::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100mm;
        background-color: rgba(255, 255, 255, 0.9) !important;
        z-index: 0;
        overflow: visible !important; /* 필요하다면 overflow 설정을 visible로 변경 */
    }

    body.printing-summary .summary-container {
        padding: 5px !important;
        margin: 0 !important;
    }

    body.printing-summary #summaryContent {
        font-size: 13px !important;
        line-height: 1.5 !important;
        color: black !important;
        padding: 0 !important;
        margin: 0 !important;
        height: calc(100% - 30mm) !important; /* Adjust for logos and purple area */
        overflow: hidden !important;
        margin-bottom: 10mm !important;
    }

    body.printing-summary #summaryContent h2 {
        font-size: 16px !important;
        font-weight: bold !important;
        margin-bottom: 3mm !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }

    body.printing-summary #summaryContent p,
    body.printing-summary #summaryContent div {
        margin-bottom: 2mm !important;
    }

    body.printing-summary .header-logo {
        position: absolute;
        top: 5mm;
        left: 5mm;
        width: 15mm;
        z-index: 2;
    }

    body.printing-summary .university-logo {
        position: absolute;
        bottom: 5mm;
        right: 5mm;
        height: 10mm;
        z-index: 2;
    }

    body.printing-summary #summaryModal .button-container,
    body.printing-summary #summaryModal .close,
    body.printing-summary #summaryModal .email-input-container {
        display: none !important;
    }
}



/* 모바일 반응형 스타일 추가 */
/* 반응형 스타일 */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 10px;
    }

    header {
        padding: 5px;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
    }

    .header-logo, .university-logo {
        height: 25px;
        width: auto;
        margin: 5px 0;
    }

    .header-text {
        flex-grow: 1;
        text-align: center;
        margin: 0 5px;
    }

    .header-text h1 {
        font-size: 0.9rem;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #chat-wrapper, .input-container {
        width: 95%;
    }

    #chat-container {
        height: calc(70vh - 100px);
    }

    .chatwindow-input {
        width: 90%;
        padding: 5px;
    }

    .chatwindow-input span {
        font-size: 0.9rem;
    }

    .chatwindow-icon {
        width: 30px;
        height: 30px;
        margin-right: 10px;
    }

    #user-input, #send-button {
        height: 36px;
    }

    #user-input {
        font-size: 0.9rem;
        padding: 5px 40px 5px 10px;
    }

    .send-icon {
        font-size: 18px;
    }

    .button-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .button-container button {
        font-size: 0.8rem;
        padding: 8px 12px;
        margin: 5px;
    }

    .message {
        display: flex;
        flex-direction: row;
        margin-bottom: 8px;
        align-items: flex-start;
    }

    .user-message {
        justify-content: flex-end;
        margin-right: 20px;
    }

    .message-wrapper {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        max-width: 75%;
    }

    .user-message .message-wrapper {
        flex-direction: row;
    }

    .message-icon {
        width: 24px;
        height: 24px;
        margin: 0 4px;
        flex-shrink: 0;
        order: -1; /* 아이콘을 항상 앞에 배치 */
    }

    .message-content {
        background-color: #f0f0f0;
        padding: 6px 8px;
        border-radius: 10px;
        font-size: 0.85rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: calc(100% - 32px);
    }

    .user-message .message-content {
        background-color: #e6f2ff;
    }

    .modal-content {
        width: 90%;
        margin: 10% auto;
        padding: 15px;
    }

    #summaryContent, #programContent {
        font-size: 14px;
    }

    .counselor-info {
        flex-direction: column;
    }

    #userEmail {
        width: 90%;
    }

    #consent-modal .modal-content {
        padding: 15px;
    }

    #consent-form .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    #consent-form label {
        width: 100%;
        text-align: left;
        margin-bottom: 5px;
    }

    #consent-form select,
    #consent-form input[type="text"] {
        width: 100%;
    }

    #consent-form .checkbox-group {
        margin-left: 0;
    }
}

@media screen and (max-width: 480px) {
    body {
        font-size: 12px;
        padding: 5px;
    }

    header {
        padding: 3px;
    }

    .header-logo, .university-logo {
        height: 20px;
    }

    .header-text h1 {
        font-size: 0.8rem;
    }

    #chat-wrapper {
        height: calc(100vh - 120px);
        margin: 5px 0;
    }

    .chatwindow-input {
        padding: 3px;
        margin-bottom: 3px;
    }

    .chatwindow-input span {
        font-size: 0.75rem;
    }

    .chatwindow-icon {
        width: 25px;
        height: 25px;
        margin-right: 5px;
    }

    .message-content {
        font-size: 0.8rem;
        padding: 5px 7px;
    }

    .message-icon {
        width: 20px;
        height: 20px;
    }

    #user-input {
        height: 30px;
        font-size: 0.8rem;
        padding: 5px 35px 5px 8px;
    }

    #send-button {
        height: 30px;
        width: 30px;
    }

    .send-icon {
        font-size: 14px;
    }

    .button-container {
        padding: 3px;
    }

    .button-container button {
        font-size: 0.7rem;
        padding: 5px 8px;
        margin: 0 3px;
    }
}

@media screen and (max-width: 320px) {
    .header-logo, .university-logo {
        height: 18px;
    }

    .header-text h1 {
        font-size: 0.7rem;
    }

    .chatwindow-input span {
        font-size: 0.7rem;
    }

    #user-input {
        font-size: 0.75rem;
    }

    .button-container button {
        font-size: 0.65rem;
        padding: 4px 6px;
    }

    .message-content {
        font-size: 0.75rem;
        padding: 4px 6px;
    }

    .message-icon {
        width: 18px;
        height: 18px;
    }
}