
.rental-calculator {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    /* 모던한 그라데이션 배경 추가 */
    background: linear-gradient(135deg, #EAF3FF 0%, #F8FBFF 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(34, 105, 247, 0.1);
}

.rental-calculator h2 {
    text-align: center;
    color: #2269F7;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #2269F7, #4A90E2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rental-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.rental-type-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 3px solid;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* 호버 효과 */
    cursor: pointer;
}

.rental-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, currentColor, rgba(255,255,255,0.3));
}

.jeonse-card {
    border-color: #FF6B6B;
    color: #FF6B6B;
}

.banjeonse-card {
    border-color: #4ECDC4;
    color: #4ECDC4;
}

.monthly-card {
    border-color: #45B7D1;
    color: #45B7D1;
}

/* 호버 효과 */
.rental-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.rental-type-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.rental-type-icon {
    font-size: 28px;
    margin-right: 12px;
}

.rental-type-title {
    font-size: 20px;
    font-weight: 700;
    color: inherit;
}

.rental-type-card .rental-input-label {
    color: inherit;
    font-weight: 600;
}

.rental-type-card .rental-input-field {
    border-color: rgba(0, 0, 0, 0.1);
}

.rental-type-card .rental-input-field:focus {
    border-color: currentColor;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.rental-options-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(34, 105, 247, 0.08);
    border: 1px solid #E6F0FF;
    margin-bottom: 20px;
}

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

.rental-input-label {
    display: block;
    color: #2269F7;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

/* 입력 단위 표시를 위한 스타일 */
.rental-input-wrapper {
    position: relative;
}

.rental-input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E6F0FF;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #FAFCFF;
    box-sizing: border-box;
    padding-right: 40px; /* 단위 텍스트 공간 확보 */
}

.rental-input-field:focus {
    outline: none;
    border-color: #2269F7;
    background: white;
    box-shadow: 0 0 0 3px rgba(34, 105, 247, 0.1);
}

.input-unit {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
    pointer-events: none; /* 클릭 방지 */
}


.rental-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E6F0FF;
    border-radius: 8px;
    background: #FAFCFF;
    color: #2269F7;
    font-size: 16px;
    cursor: pointer;
    box-sizing: border-box;
}

.rental-select:focus {
    outline: none;
    border-color: #2269F7;
    box-shadow: 0 0 0 3px rgba(34, 105, 247, 0.1);
}

.rental-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.rental-col {
    flex: 1;
    min-width: 200px;
}

/* 그라데이션 버튼 및 로딩 애니메이션 */
.rental-calculate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2269F7, #4A90E2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease, background 0.5s ease;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(34, 105, 247, 0.3);
    position: relative; /* 로딩 스피너 위치를 위해 */
    overflow: hidden; /* 빛나는 효과를 위해 */
}

/* 빛나는 효과 */
.rental-calculate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: skewX(-30deg);
    transition: all 0.7s ease;
}

.rental-calculate-btn:hover::before {
    left: 100%;
}

.rental-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 105, 247, 0.4);
}

.rental-calculate-btn:active {
    transform: translateY(0);
}

/* 로딩 스피너 */
.rental-calculate-btn.loading {
    pointer-events: none;
    background: linear-gradient(135deg, #AABFFF, #7CB0F7); /* 로딩 중 색상 변경 */
}

.rental-calculate-btn .spinner {
    display: none;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.rental-calculate-btn.loading .spinner {
    display: block;
}

.rental-calculate-btn.loading span {
    visibility: hidden; /* 텍스트 숨기기 */
}

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

/* 카드형 결과 표시 및 페이드인 효과 */
.rental-results {
    display: none; /* 초기에는 숨김 */
    opacity: 0; /* 페이드인 시작점 */
    transition: opacity 0.5s ease-in-out; /* 페이드인 애니메이션 */
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #F8FBFF 0%, #EAF3FF 100%); /* 결과 섹션 배경 */
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(34, 105, 247, 0.1);
}

.rental-results.show {
    opacity: 1; /* 페이드인 완료 */
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.result-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #E6F0FF;
    text-align: center;
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-3px);
}

.result-card .label {
    font-size: 16px;
    color: #555;
    margin-bottom: 10px;
    font-weight: 500;
}

.result-card .value {
    font-size: 24px;
    font-weight: 700;
    color: #2269F7;
}

/* 중요한 결과 하이라이트 */
.result-card.best-option {
    border-color: #28a745; /* 녹색 테두리 */
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
    background: linear-gradient(135deg, #e6ffe6, #f0fff0);
}

.result-card.best-option .label,
.result-card.best-option .value {
    color: #28a745;
}

.rental-comment {
    margin-top: 20px;
    padding: 15px;
    background: #FFF8F0;
    border-left: 4px solid #FF6600;
    border-radius: 0 8px 8px 0;
    color: #FF6600;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.5;
}

.rental-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.rental-chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(34, 105, 247, 0.08);
    border: 1px solid #E6F0FF;
    /* 차트가 네모 칸 밖으로 나가지 않게 수정 */
    position: relative; /* 차트의 부모 컨테이너가 되도록 */
    box-sizing: border-box; /* 패딩, 보더 포함하여 너비 계산 */
    overflow: hidden; /* 차트가 컨테이너를 넘어가지 않도록 */
}

/* 캔버스 요소에 최대 높이 제한 추가 */
.rental-chart-container canvas {
    max-height: 300px; /* 원하는 적절한 높이 값으로 조절 */
}

.rental-chart-title {
    text-align: center;
    color: #2269F7;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 16px;
}

/* 정보 섹션 */
.info-section {
    background: #f0faff;
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
    border: 1px dashed #a8d7ff;
    color: #2269F7;
    font-size: 14px;
    line-height: 1.6;
}

.info-section h3 {
    color: #2269F7;
    font-size: 18px;
    margin-bottom: 15px;
    border-bottom: 1px solid #cceeff;
    padding-bottom: 10px;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.info-section li::before {
    content: '💡';
    position: absolute;
    left: 0;
    color: #ff9900;
}

/* 기존 반응형 디자인 유지 및 개선 */
@media (max-width: 768px) {
    .rental-calculator {
        padding: 15px;
        margin: 0 10px;
    }
    
    .rental-calculator h2 {
        font-size: 20px;
    }
    
    .rental-types-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .rental-type-card {
        padding: 20px;
    }
    
    .rental-row {
        flex-direction: column;
    }
    
    .rental-col {
        min-width: auto;
    }
    
    .rental-charts {
        grid-template-columns: 1fr;
    }
    
    .rental-input-field, .rental-select {
        font-size: 16px;
    }
    
    /* 결과 카드 반응형 */
    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .rental-calculator {
        padding: 10px;
    }
    
    .rental-input-section, .rental-results, .rental-options-section {
        padding: 15px;
    }
    
    .rental-type-card {
        padding: 15px;
    }
    
    .rental-type-header {
        margin-bottom: 15px;
    }
    
    .rental-type-icon {
        font-size: 24px;
    }
    
    .rental-type-title {
        font-size: 18px;
    }
}

/* 3094번 글 전용 가로폭 확장 CSS (기존 요청 반영) */
@media (min-width: 1320px) {
    /* 이 목록의 요소들은 1280px로 강제 확장 및 중앙 정렬합니다. */
    .postid-3094 .rental-calculator, /* 계산기 컨테이너 */
    .postid-3094 .rental-input-section, /* 입력 섹션 */
    .postid-3094 .rental-options-section, /* 옵션 섹션 */
    .postid-3094 .rental-results /* 결과 섹션 */
    { 
        width: 1280px !important; 
        max-width: 1280px !important; 
        
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin: 20px auto !important; 
        box-sizing: border-box !important; 
    }

    /* .rental-types-grid와 .rental-charts는 내용에 맞춰 최대한 확장합니다. */
    .postid-3094 .rental-types-grid,
    .postid-3094 .rental-charts {
        width: fit-content !important; /* 내용에 맞춰 너비 자동 조절 (CSS3) */
        min-width: 100% !important;   /* 최소 100% (1280px)은 채우도록 */
        
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin: 20px auto !important; /* 위아래 여백과 중앙 정렬 */
    }
}
