* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    padding: 12px;
    color: #e0e0e0;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid #2a2a2a;
}

header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    padding: 20px 24px;
    text-align: center;
    border-bottom: 1px solid #2a2a2a;
}

header h1 {
    font-size: 1.5em;
    margin-bottom: 4px;
    font-weight: 600;
}

.subtitle {
    font-size: 0.75em;
    opacity: 0.7;
    color: #b0b0b0;
}

/* 탭 메뉴 */
.tab-menu {
    display: flex;
    background: #151515;
    border-bottom: 1px solid #2a2a2a;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: #b0b0b0;
    background: #1f1f1f;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #1a1a1a;
}

.main-content {
    padding: 20px 24px;
    min-height: calc(100vh - 280px);
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 업로드 영역 */
.upload-area {
    border: 2px dashed #3a3a3a;
    border-radius: 8px;
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #151515;
    margin-bottom: 16px;
}

.upload-area:hover {
    background: #1a1a1a;
    border-color: #667eea;
}

.upload-area.drag-over {
    background: #1f1f1f;
    border-color: #667eea;
    transform: scale(1.01);
}

.upload-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
    opacity: 0.8;
}

.upload-area p {
    font-size: 0.9em;
    color: #b0b0b0;
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 0.75em;
    color: #666;
}

/* 암호화된 파일 영역 */
.encrypted-file-area {
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.encrypted-file-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(102, 126, 234, 0.1) 10px,
        rgba(102, 126, 234, 0.1) 20px
    );
    opacity: 0.3;
    pointer-events: none;
}

.encrypted-icon {
    font-size: 3em;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.5));
    position: relative;
    z-index: 1;
}

.encrypted-file-info {
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.encrypted-file-name {
    font-size: 0.9em;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 6px;
    word-break: break-all;
}

.encrypted-file-size {
    font-size: 0.75em;
    color: #888;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.8em;
    width: auto;
    margin: 0 auto;
    display: block;
}

/* 파일 목록 */
.file-list {
    margin-bottom: 16px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #151515;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #2a2a2a;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 500;
    color: #e0e0e0;
    font-size: 0.85em;
}

.file-size {
    font-size: 0.75em;
    color: #888;
}

.btn-remove {
    background: #d32f2f;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-remove:hover {
    background: #b71c1c;
    transform: scale(1.1);
}

/* 비밀번호 섹션 */
.password-section {
    margin: 16px 0;
}

.password-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #b0b0b0;
    font-size: 0.85em;
}

.password-section input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    font-size: 0.85em;
    transition: border-color 0.2s ease;
    background: #151515;
    color: #e0e0e0;
}

.password-section input:focus {
    outline: none;
    border-color: #667eea;
}

.password-section input::placeholder {
    color: #666;
}

.password-section small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 0.75em;
}

/* 버튼 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 8px;
}

.btn-primary {
    background: #000;
    color: white;
    border: 1px solid #333;
}

.btn-primary:hover:not(:disabled) {
    background: #1a1a1a;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #1a1a1a;
}

.btn-secondary {
    background: #000;
    color: white;
    border: 1px solid #333;
}

.btn-secondary:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

.btn-copy {
    background: #000;
    color: white;
    border: 1px solid #333;
    padding: 8px 16px;
    width: auto;
    margin-left: 8px;
    font-size: 0.8em;
}

.btn-copy:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

.btn-download {
    background: #000;
    color: white;
    border: 1px solid #333;
    padding: 8px 16px;
    width: auto;
    margin: 0;
    font-size: 0.8em;
}

.btn-download:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

/* 결과 섹션 */
.result-section {
    background: #151515;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    margin-top: 16px;
}

.code-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

#shareCode {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.75em;
    resize: vertical;
    min-height: 80px;
    background: #0a0a0a;
    color: #e0e0e0;
}

.code-info {
    color: #888;
    font-size: 0.75em;
    margin: 12px 0;
    line-height: 1.5;
}

/* 다운로드 섹션 */
.code-input-section {
    background: #151515;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    margin-bottom: 16px;
}

.code-input-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #b0b0b0;
    font-size: 0.85em;
}

#codeInput {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.75em;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 12px;
    background: #0a0a0a;
    color: #e0e0e0;
}

#codeInput:focus {
    outline: none;
    border-color: #667eea;
}

#codeInput::placeholder {
    color: #666;
}

/* 다운로드 파일 영역 */
.download-file-area {
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    position: relative;
    overflow: hidden;
}

.download-file-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(102, 126, 234, 0.1) 10px,
        rgba(102, 126, 234, 0.1) 20px
    );
    opacity: 0.3;
    pointer-events: none;
}

.download-file-icon {
    font-size: 3em;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.5));
    position: relative;
    z-index: 1;
}

.download-file-info {
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.download-file-name {
    font-size: 0.9em;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 6px;
    word-break: break-all;
}

.download-file-size {
    font-size: 0.75em;
    color: #888;
}

.download-list {
    margin-top: 16px;
}

.download-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #151515;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid #2a2a2a;
}

/* 푸터 */
footer {
    background: #151515;
    padding: 12px;
    text-align: center;
    color: #666;
    font-size: 0.7em;
    border-top: 1px solid #2a2a2a;
}

/* 스크롤바 스타일링 */
.main-content::-webkit-scrollbar {
    width: 6px;
}

.main-content::-webkit-scrollbar-track {
    background: #151515;
}

.main-content::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 3px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* 반응형 */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    header h1 {
        font-size: 1.3em;
    }
    
    .main-content {
        padding: 16px;
        min-height: calc(100vh - 260px);
        max-height: calc(100vh - 260px);
    }
    
    .code-container {
        flex-direction: column;
    }
    
    .btn-copy {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }
    
    .download-file-item {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .btn-download {
        width: 100%;
    }
}
