/* ============================================
   Ewha Online Judge - Custom Styles
   ============================================ */

/* === 상단 흰 여백 === */
html {
    background: #ffffff !important;
}
body {
    padding-top: 16px !important;
    background-color: #ffffff !important;
}

/* === 상단 네비게이션 바 === */
#navigation,
#nav-list,
#nav-container {
    background: #2c2c2c !important;
}

#navigation {
    border-bottom: 1px solid #1B5E3A !important;
}

#nav-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    position: relative !important;
}

#nav-list {
    padding-left: 0 !important;
    text-align: center !important;
    display: block !important;
}

#nav-list > li.home-nav-element:nth-of-type(1) {
    position: absolute !important;
    left: 12px !important;
    top: 0 !important;
    margin: 0 !important;
}

#nav-list > li.home-nav-element:nth-of-type(2) {
    display: none !important;
}

#nav-list > li:not(.home-nav-element) {
    display: inline-block !important;
    float: none !important;
}

.ewha-logo-text {
    color: #ffffff !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    line-height: 44px !important;
    padding: 0 4px !important;
    white-space: nowrap !important;
}

#nav-list > li > a {
    color: #FFD54F !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
}

#nav-list > li.home-nav-element > a {
    color: #ffffff !important;
}
#nav-list > li.home-nav-element > a:hover {
    background: transparent !important;
}

#nav-list > li:not(.home-nav-element) > a:hover,
#nav-list > li > a.active,
#nav-list > li:not(.home-nav-element):hover > a {
    background: #1B5E3A !important;
    color: #ffffff !important;
}

#user-links,
#user-links > ul {
    background: #2c2c2c !important;
}
#user-links a {
    color: #ffffff !important;
    font-weight: 700 !important;
}
#user-links a:hover {
    background: #1B5E3A !important;
    color: #ffffff !important;
}

#navicon {
    color: #ffffff !important;
}

#nav-list ul {
    background: #ffffff !important;
}
#nav-list ul li a {
    color: #333333 !important;
    background: #ffffff !important;
    font-weight: 400 !important;
}
#nav-list ul li a:hover {
    background: #1B5E3A !important;
    color: #ffffff !important;
}

/* ============================================
   댓글 영역 - 깔끔하게
   ============================================ */

/* 페이스북/트위터 공유 버튼 숨김 */
.share,
.share-buttons,
.fb_iframe_widget,
.twitter-share-button,
[class*="facebook"],
[class*="twitter"],
iframe[src*="facebook"],
iframe[src*="twitter"] {
    display: none !important;
}

/* 댓글 에디터: Ace 에디터 본체만 줄임 */
.section-martor .ace_editor {
    height: 100px !important;
    min-height: 100px !important;
    max-height: 100px !important;
}

.section-martor .martor-preview {
    height: 100px !important;
    min-height: 100px !important;
    max-height: 100px !important;
}

/* === 댓글 큰 아바타 숨김 === */
.comment-display .info .gravatar-main,
.comment-display .info .user-gravatar {
    display: none !important;
}

/* 아바타 빠지면서 vote 영역만 남도록 info 영역 정렬 조정 */
.comment-display .info {
    width: auto !important;
    min-width: 40px !important;
}

/* 댓글 헤더의 모바일용 작은 아바타도 숨김 (있을 경우) */
.comment-display .gravatar-mobile {
    display: none !important;
}

/* === 메인 페이지 Comment stream 사이드바 박스 숨김 === */
.blog-sidebar .blog-sidebox:has(h3 .fa-comments) {
    display: none !important;
}

/* 다크모드 강제 무시 - 항상 흰 배경 */
html, body {
    background-color: #ffffff !important;
    color: #000000 !important;
    color-scheme: light !important;
}


/* ===== 제출 페이지 좌우 분할 ===== */
#ewha-split-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 10px;
}
#ewha-split-left {
    flex: 1;
    min-width: 0;
    padding-right: 10px;
    border-right: 1px solid #ddd;
}
#ewha-split-left h2 {
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #1B5E3A;
}
#ewha-split-left .content-description {
    line-height: 1.7;
}
#ewha-split-right {
    flex: 1;
    min-width: 0;
}
#ewha-split-right #ace_source {
    min-height: 500px;
}

/* 모바일 다크모드 강제 무시 */
@media (prefers-color-scheme: dark) {
    html, body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
}

/* 제출 안내 메시지 */
.ewha-submit-notice {
    font-size: 13px;
    color: #1B5E3A;
    margin-bottom: 8px;
    text-align: right;
}
.ewha-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1B5E3A;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: ewha-toast-fade 2.5s ease;
}
@keyframes ewha-toast-fade {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* 다크 테마 사용자도 하얀 배경 강제 */
body.dark, body.dark * {
    background-color: #ffffff !important;
    color: #000000 !important;
}
body.dark a { color: #1a73e8 !important; }
body.dark #navigation, body.dark #nav-list {
    background-color: #2c2c2c !important;
}
body.dark #nav-list a { color: #FFD54F !important; }
body.dark .button, body.dark input[type="submit"] {
    background-color: #1B5E3A !important;
    color: #ffffff !important;
}

/* ACE 에디터 폰트 사이즈 강제 */
.ace_editor, .ace_editor * {
    font-size: 18px !important;
    line-height: 1.4 !important;
}

/* 채점 언어 안내문 */
.ewha-lang-notice {
    background: #f0f7f1;
    border-left: 3px solid #1B5E3A;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #1B5E3A;
}

/* 언어 선택 / judge 선택 펼침 목록 숨김 */
#submit-wrapper #language,
.submit-bar select,
.submit-bar .select2-container {
    display: none !important;
}

/* 안내문 + 제출 버튼 한 줄 정렬 */
.submit-bar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}
.ewha-submit-notice {
    margin-bottom: 0 !important;
    text-align: left !important;
    flex: 1;
}

/* 안내문 좌측, 제출 버튼 우측 강제 정렬 */
#ewha-split-right .submit-bar {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px;
}
#ewha-split-right .submit-bar .ewha-submit-notice {
    flex: 1 1 auto !important;
    text-align: left !important;
    margin: 0 !important;
}
#ewha-split-right .submit-bar input[type="submit"] {
    flex: 0 0 auto !important;
    margin-left: auto !important;
}

/* ===== 프로필 수정 페이지 간소화 ===== */

/* 시간대/언어/편집기테마/수학엔진 행 */
#edit-form tr:has(#id_timezone),
#edit-form tr:has(#id_language),
#edit-form tr:has(#id_site_theme),
#edit-form tr:has(#id_ace_theme),
#edit-form tr:has(#id_math_engine) {
    display: none !important;
}

/* Affiliated organizations (sortedm2m) */
#edit-form .pane:has(.sortedm2m-container) {
    display: none !important;
}

/* 베타 기능 활성화 */
#edit-form tr:has(#id_test_site) {
    display: none !important;
}

/* Change your email */
#edit-form tr:has(a[href*="email"]) {
    display: none !important;
}

/* API 토큰 */
#edit-form tr:has(#api-token-td) {
    display: none !important;
}

/* 2단계 인증 영역 — 2fa 링크를 포함한 .pane 통째로 */
#edit-form .pane:has(a[href*="2fa"]) {
    display: none !important;
}

/* 사용자 스크립트 — 라벨, 에디터, 위 hr */
#edit-form > .form-area > .block-header.grayed:has(+ textarea[name="user_script"]),
#edit-form > .form-area > textarea[name="user_script"],
#edit-form > .form-area > div.ace_editor:has(+ hr + input[type="submit"]),
#edit-form > .form-area > hr:has(+ .block-header.grayed:has(+ textarea[name="user_script"])) {
    display: none !important;
}

/* 사용자 스크립트가 위 셀렉터로 안 잡히면 — 마지막 ace_editor (자기소개 ace는 textarea[name="about"] 옆에 있음) */
#edit-form > .form-area textarea[name="user_script"] + .ace_editor,
#edit-form > .form-area textarea[name="user_script"] ~ .ace_editor {
    display: none !important;
}

/* 사용자 스크립트 — block-header 라벨, django-ace-editor, 그 위 hr */
#edit-form .block-header.grayed:has(+ .django-ace-editor),
#edit-form .django-ace-editor,
#edit-form hr:has(+ .block-header.grayed + .django-ace-editor) {
    display: none !important;
}

/* Custom: Hide PDF view and report buttons */
.view-pdf, .button.clarify { display: none !important; }

/* === Category column one-line === */
body table#problem-table td.problem,
body table#problem-table th.problem {
    width: auto !important;
}
body table#problem-table td.category,
body table#problem-table th.category,
html body #problem-table tr td.category {
    white-space: nowrap !important;
    width: 130px !important;
    min-width: 130px !important;
}
