/*
* 파일명: style.css
* 경로: /p/password-generator/assets/css/
* 기능: 비밀번호 생성기 (성능최적화 + 가독성강화 + 2단레이아웃)
* 작성일: 2025-01-15
* 수정일: 2025-01-15
*/

/* ===================================
* 최적화된 CSS 변수
* =================================== */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* 가독성 강화 배경색 */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-section: #e0e7ff;
    --bg-option: #f1f5f9;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border: #cbd5e1;
    --border-strong: #94a3b8;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

/* ===================================
* 기본 스타일 (성능 최적화)
* =================================== */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: system-ui, -apple-system, sans-serif;
}

.webtools-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ===================================
* 히어로 섹션
* =================================== */
.password-hero {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1.2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 2px solid var(--border);
}

.webtools-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.webtools-title {
    color: var(--text-primary);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.webtools-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

/* ===================================
* 메인 카드 + 2단 레이아웃
* =================================== */
.webtools-card {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-strong);
    margin-bottom: 2rem;
}

.webtools-card-body {
    padding: 2rem;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===================================
* 비밀번호 출력 영역 (가독성 강화)
* =================================== */
.password-display {
    background: var(--bg-section);
    border: 3px solid var(--border-strong);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 0.8rem;
}

.password-output {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    word-break: break-all;
    user-select: all;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 1rem;
    flex-shrink: 0;
    font-weight: 500;
}

.copy-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ===================================
* 강도 표시 (간소화)
* =================================== */
.strength-display {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
}

.strength-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.strength-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.strength-weak { background: var(--danger); }
.strength-fair { background: var(--warning); }
.strength-strong { background: var(--success); }
.strength-very-strong { background: var(--primary); }

.strength-text {
    font-weight: 600;
    min-width: 80px;
}

.crack-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===================================
* 옵션 섹션 (명확한 구분)
* =================================== */
.option-section {
    background: var(--bg-section);
    border: 3px solid var(--border-strong);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 0.5rem;
}

.option-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.option-title i {
    color: var(--primary);
    margin-right: 0.5rem;
}

/* ===================================
* 버튼 스타일
* =================================== */
.btn-primary {
    background: var(--primary);
    border: none;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 25px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ===================================
* 슬라이더
* =================================== */
.range-container {
    position: relative;
    margin: 1rem 0;
}

.form-range {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    position: absolute;
    right: 0;
    top: -30px;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===================================
* 개수 조절
* =================================== */
.count-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
}

.count-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.count-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.count-display {
    background: var(--bg-option);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* ===================================
* 체크박스 그리드
* =================================== */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid var(--border);
}

.form-check {
    background: var(--bg-option);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.form-check:hover {
    background: var(--bg-section);
    border-color: var(--primary);
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
}

/* ===================================
* 광고 영역
* =================================== */
.ad-area {
    background: linear-gradient(135deg, var(--bg-option) 0%, var(--bg-section) 100%);
    border: 2px dashed var(--border-strong);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

/* ===================================
* 여러 비밀번호 결과
* =================================== */
.multiple-results {
    grid-column: 1 / -1;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border);
}

.password-item {
    background: var(--bg-option);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===================================
* 콘텐츠 섹션 (성능 최적화)
* =================================== */
.content-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    content-visibility: auto;
    contain-intrinsic-size: 1px 600px;
}

.section-title {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

/* 2x2 그리드 */
.feature-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .feature-grid-2x2 {
        grid-template-columns: 1fr 1fr;
    }
}

.feature-item {
    background: var(--bg-option);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.feature-item h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.feature-item h5 i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.feature-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

/* ===================================
* FAQ 아코디언
* =================================== */
.accordion-item {
    border: 2px solid var(--border);
    border-radius: 8px !important;
    margin-bottom: 1rem;
}

.accordion-button {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
    border: none;
    padding: 1.25rem;
}

.accordion-button:not(.collapsed) {
    background: var(--primary);
    color: white;
}

.accordion-body {
    background: var(--bg-option);
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 1.25rem;
}

/* ===================================
* 반응형 디자인
* =================================== */
@media (max-width: 991px) {
    .webtools-card-body {
        padding: 1.5rem;
    }
    
    .content-section {
        padding: 1.5rem;
    }
}

@media (max-width: 575px) {
    .password-output {
        flex-direction: column;
        align-items: stretch;
    }
    
    .copy-btn {
        margin-left: 0;
        margin-top: 1rem;
    }
}

/* 텍스트 색상 클래스 */
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-success { color: var(--success) !important; }
.text-primary { color: var(--primary) !important; }
