/* ============================================
   네비게이션 바
   ============================================ */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 0.9rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.4rem;
    color: white;
    cursor: pointer;
    font-weight: 600;
}

.nav-brand h1 a {
    color: white;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 400;
    font-size: 0.95rem;
}

.nav-menu a:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.btn-login {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-login:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* ============================================
   프로필 드롭다운
   ============================================ */
.profile-container {
    position: relative;
}

.profile-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: opacity 0.3s;
}

.profile-btn:hover {
    opacity: 0.8;
}

.profile-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.profile-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-image-default {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: #1a1a1a;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.2);
}

.dropdown-header {
    padding: 1rem;
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-profile-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-profile-default {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.dropdown-user-name {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}

.dropdown-divider {
    height: 1px;
    background: #333;
    margin: 0;
}

.dropdown-menu {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #007bff;
    color: #fff;
}

.dropdown-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* ============================================
   푸터
   ============================================ */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 1px solid #ddd;
}

.footer .container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer p {
    margin: 0 0 15px 0;
    font-size: 14px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #007bff;
    text-decoration: underline;
}

/* ============================================
   폼 공통 스타일
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input.error {
    border-color: #dc3545;
}

.form-group input:disabled {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
}

.helper-text {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

.error-text {
    display: none;
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

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

.required {
    color: #dc3545;
    font-weight: bold;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ============================================
   아바타
   ============================================ */
.author-avatar-large,
.author-avatar-small {
    border-radius: 50%;
    object-fit: cover;
}

.author-avatar-large {
    width: 40px;
    height: 40px;
}

.author-avatar-small {
    width: 32px;
    height: 32px;
}

.author-avatar-default,
.comment-avatar-default {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.author-avatar-default {
    width: 40px;
    height: 40px;
    font-size: 20px;
}

.comment-avatar-default {
    width: 32px;
    height: 32px;
    font-size: 16px;
}

/* ✅ 메시지 컨테이너 - 고정 높이 확보 */
.form-message {
    min-height: 1.5em;
    margin-top: 0.25rem;
    position: relative;
}

.form-message .helper-text,
.form-message .error-text {
    display: block;
    font-size: 0.85rem;
    line-height: 1.5em;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: opacity 0.2s;
}

.form-message .helper-text {
    color: #666;
    opacity: 1;
}

.form-message .error-text {
    color: #dc3545;
    opacity: 0;
    visibility: hidden;
}

.form-message .error-text.show {
    opacity: 1;
    visibility: visible;
}

/* ✅ 에러 발생 시 helper-text 숨김 */
.form-message .error-text.show ~ .helper-text {
    opacity: 0;
    visibility: hidden;
}

/* ============================================
   비밀번호 입력 토글
   ============================================ */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 45px; /* 버튼 공간 확보 */
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
    border-radius: 4px;
    width: 36px;
    height: 36px;
}

.password-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

.password-toggle-btn:active {
    background-color: rgba(0, 0, 0, 0.1);
}

.password-toggle-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.eye-icon {
    width: 20px;
    height: 20px;
    transition: opacity 0.2s;
}

/* ============================================
   반응형 - 모바일
   ============================================ */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .profile-dropdown {
        min-width: 200px;
        right: -10px;
    }

    .dropdown-user-name {
        font-size: 0.9rem;
    }

    .dropdown-item {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .form-actions {
        flex-direction: column;
    }

}