/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: 
        radial-gradient(circle at 20% 50%, rgba(58, 123, 213, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 210, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #16213e 75%, #1a1a2e 100%);
    min-height: 100vh;
    color: #e0e0e0;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%233a7bd5" opacity="0.15"/><circle cx="50" cy="10" r="0.5" fill="%2300d2ff" opacity="0.2"/><circle cx="80" cy="40" r="0.8" fill="%23ffffff" opacity="0.08"/><circle cx="20" cy="60" r="0.6" fill="%233a7bd5" opacity="0.12"/></svg>') repeat;
    animation: floatParticles 20s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes floatParticles {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-100vh) rotate(360deg); }
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: #ffffff;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 
        0 0 20px rgba(58, 123, 213, 0.5),
        0 0 40px rgba(58, 123, 213, 0.3),
        0 0 60px rgba(58, 123, 213, 0.1);
    background: linear-gradient(45deg, #3a7bd5, #00d2ff, #3a7bd5);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    position: relative;
}

header h1::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(58, 123, 213, 0.1) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.1; }
}

header p {
    font-size: 1.1rem;
    opacity: 0.8;
    color: #b0b0b0;
}

/* 페이지 전환 */
.page {
    display: none;
    background: 
        linear-gradient(135deg, rgba(30, 30, 46, 0.9) 0%, rgba(20, 20, 36, 0.95) 100%);
    border: 1px solid rgba(58, 123, 213, 0.4);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.5),
        0 0 30px rgba(58, 123, 213, 0.15),
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 -1px 0 rgba(0,0,0,0.3);
    margin-bottom: 20px;
    backdrop-filter: blur(25px);
    position: relative;
    overflow: hidden;
}

.page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(58, 123, 213, 0.8), transparent);
    animation: borderGlow 2s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.page.active {
    display: block;
}

/* 버튼 스타일 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.btn:hover::after {
    left: 100%;
}

.btn.primary {
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 50%, #3a7bd5 100%);
    background-size: 200% 100%;
    color: white;
    border: 1px solid rgba(58, 123, 213, 0.6);
    box-shadow: 
        0 8px 20px rgba(58, 123, 213, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    animation: gradientShift 3s ease infinite;
}

.btn.primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 30px rgba(58, 123, 213, 0.5),
        0 6px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    background-position: 100% 0;
}

.btn.primary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 
        0 4px 15px rgba(58, 123, 213, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn.secondary {
    background: rgba(40, 40, 60, 0.8);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn.secondary:hover {
    background: rgba(50, 50, 70, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.btn.danger {
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
    color: white;
    border: 1px solid rgba(255, 71, 87, 0.5);
}

.btn.danger:hover {
    background: linear-gradient(135deg, #ff5777 0%, #ff4858 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

/* 메인 페이지 */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    min-width: 200px;
    padding: 20px 30px;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    background-size: 200% 100%;
}

.action-buttons .btn:hover {
    transform: translateY(-3px) scale(1.05);
    animation: buttonPulse 0.6s ease;
}

@keyframes buttonPulse {
    0% { transform: translateY(-3px) scale(1.05); }
    50% { transform: translateY(-5px) scale(1.08); }
    100% { transform: translateY(-3px) scale(1.05); }
}

/* 폼 스타일 */
.form-container {
    max-width: 500px;
    margin: 0 auto;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(58, 123, 213, 0.5);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #b0b0b0;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: 
        linear-gradient(135deg, rgba(40, 40, 60, 0.8) 0%, rgba(35, 35, 55, 0.9) 100%);
    color: #e0e0e0;
    backdrop-filter: blur(15px);
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: #999;
    transition: color 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #3a7bd5;
    box-shadow: 
        0 0 20px rgba(58, 123, 213, 0.4),
        0 0 40px rgba(58, 123, 213, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.2);
    background: 
        linear-gradient(135deg, rgba(50, 50, 70, 0.9) 0%, rgba(45, 45, 65, 0.95) 100%);
    transform: translateY(-1px);
}

.input-group input:focus::placeholder,
.input-group textarea:focus::placeholder {
    color: #bbb;
}

.input-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.form-actions .btn {
    flex: 1;
}

/* 볼트 내부 */
.vault-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(58, 123, 213, 0.3);
}

.vault-header h2 {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(58, 123, 213, 0.5);
}

.vault-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.vault-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* 아이템 컨테이너 */
.items-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.vault-item {
    background: 
        linear-gradient(135deg, rgba(30, 30, 46, 0.9) 0%, rgba(25, 25, 41, 0.95) 100%);
    border: 1px solid rgba(58, 123, 213, 0.3);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.vault-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3a7bd5, #00d2ff, #3a7bd5);
    background-size: 200% 100%;
    transform: scaleX(0);
    transition: transform 0.4s ease;
    animation: gradientFlow 3s ease infinite;
}

.vault-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(58, 123, 213, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.vault-item:hover::before {
    transform: scaleX(1);
}

.vault-item:hover::after {
    opacity: 1;
}

.vault-item:hover {
    border-color: #3a7bd5;
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(58, 123, 213, 0.3),
        0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: 
        linear-gradient(135deg, rgba(40, 40, 56, 0.95) 0%, rgba(35, 35, 51, 1) 100%);
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.item-type {
    background: linear-gradient(135deg, #3a7bd5, #00d2ff);
    color: white;
    padding: 6px 14px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    box-shadow: 
        0 3px 8px rgba(58, 123, 213, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.item-type::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.item-type:hover::before {
    left: 100%;
}

.item-type.file {
    background: linear-gradient(135deg, #00b894, #00cec9);
}

.item-type.text {
    background: linear-gradient(135deg, #0984e3, #74b9ff);
}

.item-type.url {
    background: linear-gradient(135deg, #e17055, #fdcb6e);
}

.item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.item-description {
    color: #b0b0b0;
    margin-bottom: 15px;
    line-height: 1.5;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.item-actions .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(58, 123, 213, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(0, 210, 255, 0.1) 0%, transparent 50%),
        rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

.modal-content {
    background: 
        linear-gradient(135deg, rgba(30, 30, 46, 0.97) 0%, rgba(25, 25, 41, 0.99) 100%);
    border: 1px solid rgba(58, 123, 213, 0.4);
    padding: 35px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 
        0 30px 60px rgba(0,0,0,0.6),
        0 0 40px rgba(58, 123, 213, 0.25),
        inset 0 1px 0 rgba(255,255,255,0.15),
        inset 0 -1px 0 rgba(0,0,0,0.3);
    backdrop-filter: blur(25px);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(58, 123, 213, 0.8), transparent);
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes borderPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

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

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #888;
    transition: all 0.3s ease;
}

.close:hover {
    color: #3a7bd5;
    transform: rotate(90deg);
}

.modal-content h3 {
    margin-bottom: 25px;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(58, 123, 213, 0.5);
}

/* 로딩 스피너 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(58, 123, 213, 0.2);
    border-top: 4px solid #3a7bd5;
    border-radius: 50%;
    animation: 
        spin 1.2s linear infinite,
        glow 2s ease-in-out infinite;
    margin-bottom: 25px;
    position: relative;
}

.spinner::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid transparent;
    border-top: 2px solid rgba(0, 210, 255, 0.6);
    border-radius: 50%;
    animation: spin 0.8s linear infinite reverse;
}

.spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(58, 123, 213, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: innerPulse 1.5s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(58, 123, 213, 0.3),
            0 0 40px rgba(58, 123, 213, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 30px rgba(58, 123, 213, 0.5),
            0 0 60px rgba(58, 123, 213, 0.2);
    }
}

@keyframes innerPulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.2); }
}

.loading p {
    color: #e0e0e0;
    font-size: 1.1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 알림 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 1500;
    animation: slideInRight 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.notification.hidden {
    display: none;
}

.notification.error {
    background: linear-gradient(135deg, #ff4757, #ff3838);
}

.notification.warning {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    color: white;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .page {
        padding: 25px;
        margin: 10px;
        border-radius: 16px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .action-buttons .btn {
        width: 100%;
        max-width: 300px;
        padding: 18px 25px;
    }
    
    .vault-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .vault-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .items-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modal-content {
        padding: 25px;
        margin: 15px;
        border-radius: 16px;
    }
    
    .vault-item {
        padding: 20px;
    }
    
    .spinner {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
        padding: 20px;
    }
    
    .page {
        padding: 20px;
    }
    
    .vault-item {
        padding: 15px;
    }
    
    .input-group input,
    .input-group textarea {
        padding: 12px 16px;
    }
}

/* 고급 호버 효과 */
.vault-item {
    cursor: pointer;
}

.btn {
    cursor: pointer;
    user-select: none;
}

/* 마이크로 인터랙션 */
.input-group label {
    transition: all 0.3s ease;
}

.input-group:focus-within label {
    color: #3a7bd5;
    transform: translateY(-2px);
}

/* 글로벌 애니메이션 비활성화 옵션 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}