/* 공통 반응형 CSS */

/* 기본 반응형 설정 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 컨테이너 반응형 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 테이블 반응형 wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-responsive table {
    min-width: 800px; /* 최소 너비 보장 */
    width: 100%;
    border-collapse: collapse;
}

/* 버튼 반응형 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* 모바일에서 버튼 크기 증가 */
@media (max-width: 768px) {
    .btn {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 44px; /* 터치 최적화 */
    }
    
    .btn-sm {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 40px;
    }
}

/* 개인 아이디 비밀번호 모달 스타일 */
.personal-login-info-item {
    margin-bottom: 15px;
}

.personal-login-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 0.5px solid #e1e5e9;
}

.personal-login-info-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.personal-login-info-content {
    display: flex;
    flex-direction: column;
}

.personal-login-info-single-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    flex-wrap: wrap;
}

.personal-login-info-single-row:last-child {
    border-bottom: none;
}

.personal-login-info-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.personal-login-info-value {
    font-size: 15px;
    color: #333;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 0.5px solid #e9ecef;
    min-width: 150px;
}

.personal-login-info-value.url {
    color: #667eea;
    font-weight: 500;
}

.personal-login-info-value.credentials {
    color: #495057;
}

.personal-login-info-copy {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 70px;
}

.personal-login-info-copy:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

.personal-login-info-copy:active {
    transform: scale(0.95);
}

.personal-login-info-description {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 0.5px solid #e1e5e9;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.personal-login-info-date {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-header .close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-header .close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-width: none;
    }
    
    .modal-header {
        padding: 20px 20px 0 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px;
        max-height: 70vh;
    }
    
    .modal-large {
        width: 95%;
        margin: 5% auto;
    }
}

/* 큰 모달 스타일 */
.modal-large {
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
}

/* 카드 레이아웃 */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* 그리드 시스템 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-12 { flex: 0 0 100%; }
.col-6 { flex: 0 0 50%; }
.col-4 { flex: 0 0 33.333333%; }
.col-3 { flex: 0 0 25%; }

/* 모바일 그리드 */
@media (max-width: 768px) {
    .col-md-12 { flex: 0 0 100%; }
    .col-md-6 { flex: 0 0 50%; }
    .col-md-4 { flex: 0 0 100%; }
    .col-md-3 { flex: 0 0 100%; }
}

/* 네비게이션 반응형 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.navbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

.navbar-brand {
    font-size: 24px;
    font-weight: 600;
    color: white;
    text-decoration: none;
    margin: 0;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.navbar-nav li {
    margin: 0;
    white-space: nowrap;
}

.navbar-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s ease;
    font-size: 14px;
}

.navbar-nav a:hover {
    background: rgba(255,255,255,0.2);
}

.user-name {
    color: white;
    font-weight: 500;
    margin-right: 5px;
    font-size: 14px;
}

.team-badge {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 3px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

/* PC용 모바일 전용 요소 숨김 */
@media (min-width: 769px) {
    .navbar-nav .user-info-mobile,
    .navbar-nav .account-links,
    .navbar-nav .nav-divider,
    .navbar-nav .nav-section {
        display: none !important;
    }
    
    /* PC용 아이콘 스타일 */
    .navbar-nav .account-icons {
        display: flex;
        align-items: center;
        gap: 0;
        margin-left: 10px;
    }
    
    .navbar-nav .account-icons a {
        font-size: 16px;
        padding: 8px 5px;
        border-radius: 50%;
        transition: background-color 0.2s;
        margin-right: 8px;
    }
    
    .navbar-nav .account-icons a i {
        font-size: 16px;
    }
    
    .navbar-nav .account-icons a:hover {
        background: none;
    }
    
    /* account-icons 드롭다운 위치 조정 */
    .navbar-nav .account-icons .dropdown-menu {
        right: 0;
        left: auto;
        min-width: 150px;
    }
}

/* 디렉터 연락 모달 스타일 */
#directorContactModal .modal-content {
    max-width: 500px;
    width: 90%;
    margin: 50px auto;
}

#directorContactModal .form-group {
    margin-bottom: 20px;
}

#directorContactModal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

#directorContactModal textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

#directorContactModal textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

#directorContactModal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

#directorContactModal .form-actions .btn {
    min-width: 80px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}

/* 모바일용 PC 전용 요소 숨김 */
@media (max-width: 768px) {
    .navbar-nav > li:not(.nav-section):not(.nav-divider) {
        display: none !important;
    }
    
    #directorContactModal .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    #directorContactModal .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    #directorContactModal .form-actions .btn {
        width: 100%;
    }
}

/* 드롭다운 메뉴 */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-toggle i {
    font-size: 12px;
    transition: none;
}

.dropdown:hover .dropdown-toggle i {
    transform: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 8px 0;
    margin: 0;
    list-style: none;
}

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

.dropdown-menu li {
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid #f8f9fa;
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    border: none;
    outline: none;
}

.dropdown-menu a:hover {
    background: #f8f9fa;
    color: #667eea;
}

/* 견적서 서브메뉴 */
.estimate-submenu {
    background: white;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.estimate-submenu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.estimate-submenu-list {
    display: flex;
    gap: 0;
}

.estimate-submenu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.estimate-submenu-item:hover {
    color: #667eea;
    background: #f8f9fa;
    text-decoration: none;
}

.estimate-submenu-item.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9fa;
}

.estimate-submenu-item i {
    font-size: 16px;
}

/* 서브메뉴 반응형 */
@media (max-width: 768px) {
    .estimate-submenu-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .estimate-submenu-list {
        flex-wrap: nowrap;
        min-width: max-content;
        gap: 0;
    }
    
    .estimate-submenu-item {
        flex: none;
        min-width: 140px;
        padding: 12px 15px;
        font-size: 13px;
        text-align: center;
        justify-content: center;
        white-space: nowrap;
    }
    
    .estimate-submenu-item i {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .estimate-submenu-item {
        min-width: 120px;
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .estimate-submenu-item i {
        font-size: 12px;
    }
}

/* 모바일 드롭다운 */
.mobile-dropdown {
    position: relative;
}

.mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mobile-dropdown-menu {
    display: none;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 10px 0;
}

.mobile-dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #e9ecef;
}

.mobile-dropdown-menu a:last-child {
    border-bottom: none;
}

.mobile-dropdown-menu a:hover {
    background: #e9ecef;
    color: #667eea;
}

/* 모바일 네비게이션 */
@media (max-width: 768px) {
    .navbar-nav {
        flex-direction: column;
        position: fixed;
        top: 74px;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        display: none;
        z-index: 1000;
        width: 100%;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .navbar-nav.active {
        display: block !important;
    }
    
    .navbar-nav li {
        margin: 0;
        border-bottom: 1px solid #e9ecef;
    }
    
    .navbar-nav a {
        display: block;
        padding: 15px 20px;
        color: #333;
        font-size: 16px;
        font-weight: 500;
    }
    
    .navbar-nav a:hover {
        background: #f8f9fa;
    }
    
    /* 모바일 메뉴 섹션 스타일 */
    .nav-section {
        border-bottom: 1px solid #e9ecef;
    }
    
    .nav-section:last-child {
        border-bottom: none;
    }
    
    .user-info-mobile {
        padding: 10px 0 0;
        background: #f8f9fa;
        text-align: center;
    }
    
    .user-info-mobile .user-name {
        color: #333;
        display: inline-block;
        font-size: 16px;
        font-weight: 600;
        margin-right: 12px;
        vertical-align: middle;
    }
    
    .user-info-mobile .team-badge {
        background: #667eea;
        color: white;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 500;
        display: inline-block;
        vertical-align: middle;
    }
    
    .account-links {
        padding: 10px 0 0px;
        background: #f8f9fa;
        display: flex;
        gap: 15px;
        justify-content: center;
    }
    
    .account-links a {
        color: #333;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        padding: 8px 16px;
        border-radius: 6px;
        transition: background-color 0.2s;
    }
    
    .account-links a:hover {
        background: #e9ecef;
    }
    
    .nav-divider {
        height: 1px;
        background: #e9ecef;
        margin: 0;
        border: none;
    }
    
    .navbar-header {
        width: 100%;
    }
    
    /* 모바일에서 햄버거 메뉴 개선 */
    .navbar-toggle {
        background: rgba(255,255,255,0.2);
        border-radius: 4px;
        padding: 8px 12px;
    }
    
    .navbar-toggle:hover {
        background: rgba(255,255,255,0.3);
    }
}

/* 햄버거 메뉴 */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    color: white;
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }
}

/* 폼 반응형 */
.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* 모바일에서 폼 요소 크기 증가 */
@media (max-width: 768px) {
    .form-control {
        padding: 12px 16px;
        font-size: 16px; /* iOS 줌 방지 */
        min-height: 44px;
    }
}

/* 유틸리티 클래스 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

@media (max-width: 768px) {
    .d-md-none { display: block; }
    .d-md-block { display: block; }
}

/* 푸터 스타일 */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
}

.footer p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.footer a {
    color: #007bff;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 터치 최적화 */
@media (max-width: 768px) {
    /* 터치 영역 최소 44px */
    button, a, input:not([type="checkbox"]), select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 터치 간격 */
    .btn + .btn {
        margin-left: 10px;
    }
    
    /* 스크롤 최적화 */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 모바일 푸터 */
    .footer {
        padding: 15px 0;
        margin-top: 30px;
    }
}

 