/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Container */
.container {
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    flex: 1; 
}

/* Header */
header {
    background: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

header .home-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    justify-content: center;
    color: #fff;
}

header h1 {
    margin: 0;
    font-size: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar */
aside {
    width: 20%;
    float: left;
    background: #f4f4f4;
    padding: 15px;
    margin: 0;
}

aside nav ul {
    list-style: none;
    padding: 0;
}

aside nav ul ul {
    display: none;
    padding-left: 15px; /* Reduced padding for more compact submenu */
}

aside nav ul li {
    margin-bottom: 10px;
}

aside nav ul li ul li {
    margin-bottom: 3px; /* Reduced margin for submenu items */
}

aside nav ul li ul li a {
    background: #eee; /* Slightly different background for submenu items */
    padding: 4px; /* Reduced padding for submenu items */
}

aside nav ul li a {
    text-decoration: none;
    color: #333;
    background: #ddd;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 5px;
    cursor: pointer;
}

aside nav ul li a:hover {
    background: #bbb;
}

.arrow {
    transition: transform 0.2s ease;
}

.expanded .arrow {
    transform: rotate(90deg);
}

aside nav ul ul {
    display: none;
    padding-left: 20px;
}

aside nav ul li.expanded > ul {
    display: block;
}

main {
    width: 75%;
    float: left;
    padding: 20px;
    margin-left: 2%;
}

main section {
    display: none; /* Hide all sections by default */
    margin-bottom: 20px;
}

main h2 {
    margin-bottom: 10px;
    color: #333;
}

main section.active {
    display: block; /* Show active section */
}

/* Footer */
footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    width: 100%;
}

/* 신발쪽 추가하면서 추가 */
/* 그라디언트 배경 */
.gradient-bg-blue {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 100%);
}

.gradient-bg-indigo {
    background: linear-gradient(135deg, #eef2ff 0%, #dbeafe 100%);
}

/* 공통 카드 스타일 확장 */
.card-xl {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 2rem;
}

/* 버튼 스타일 확장 */
.btn-toggle {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-toggle.active {
    background-color: #4f46e5;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-toggle.inactive {
    background-color: #f3f4f6;
    color: #374151;
}

.btn-toggle.inactive:hover {
    background-color: #e5e7eb;
}

/* 입력 필드 스타일 확장 */
.input-group {
    display: flex;
    gap: 1rem;
}

.input-field-enhanced {
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.input-field-enhanced:focus {
    outline: none;
    box-shadow: 0 0 0 2px #4f46e5;
    border-color: #4f46e5;
}

/* 결과 표시 그리드 */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* 도움말 박스 스타일 */
.help-box {
    padding: 1rem;
    background-color: #fefce8;
    border-radius: 0.5rem;
    border: 1px solid #fde047;
}

.help-box .title {
    font-weight: 500;
    color: #92400e;
    margin-bottom: 0.5rem;
}

.help-box .content {
    font-size: 0.875rem;
    color: #a16207;
}

/* 아이콘 스타일 */
.icon-indigo {
    color: #4f46e5;
}

.icon-gray {
    color: #6b7280;
}

/* 텍스트 크기 유틸리티 */
.text-result {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4f46e5;
}

.text-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
    .container {
        display: flex;
        flex-direction: column;
    }

    aside {
        width: 100%;
        float: none;
        order: 1;
    }

    main {
        width: 100%;
        float: none;
        margin-left: 0;
        padding: 20px;
        text-align: center; /* Center-align text */
        display: flex;
        flex-direction: column;
        align-items: center; /* Center-align flex items */
    }

    main section {
        width: 100%; /* Full width for sections */
        max-width: 600px; /* Optional: set a max-width for readability */
    }
    
    main h2 {
        text-align: center; /* Center-align headings */
    }

    footer {
        order: 2;
    }

    #simple-calculator {
        width: 100%; /* Adjust width for mobile */
        max-width: 300px;
        margin: 20px auto; /* Center the calculator horizontally */
    }

    #scientific-calculator {
        width: 100%; /* Adjust width for mobile */
        max-width: 400px;
        margin: 20px auto; /* Center the calculator horizontally */
    }

    .calculator-buttons button {
        padding: 15px; /* Adjust button padding for mobile */
        grid-template-columns: repeat(4, 1fr); /* 4 columns for buttons */
        gap: 10px; /* Space between buttons */
    }

    .reset {
        width: 100%; /* Full width buttons */
        padding: 15px 0; /* Adjust padding as needed */
        font-size: 1em;
    }

    /* 신발쪽 추가하면서 추가 */
    .input-group {
        flex-direction: column;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .card-xl {
        padding: 1.5rem;
    }
}

/* ===== 기존 styles.css 파일 끝에 추가할 내용 ===== */

/* 다크모드 기본 스타일 오버라이드 */
body {
    background: #0a0a0a !important;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(78, 205, 196, 0.2) 0%, transparent 50%) !important;
    color: #e2e8f0 !important;
}

/* 홈페이지 전용 스타일 */
.home-content {
    padding: 2rem 0;
}

.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
}

.welcome-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #667eea 50%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-section p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.3);
}

.tool-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.tool-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}

.tool-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.tool-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.tool-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* 기존 사이드바 다크모드 개선 */
aside {
    background: rgba(15, 15, 15, 0.8) !important;
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

aside nav ul li a {
    color: rgba(255, 255, 255, 0.7) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

aside nav ul li a:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    color: #ffffff !important;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .welcome-section h1 {
        font-size: 2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .home-content {
        padding: 1rem 0;
    }
}