/* =============================================================================
   Hardware Calculator Page Custom Styles
   기존 디자인 시스템과 일관성을 유지하면서 서버 사양 계산기에 특화된 스타일
   ============================================================================= */

/* =============================================================================
   Mode Toggle Switch Styling
   ============================================================================= */

.mode-toggle-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.mode-toggle {
    position: relative;
    display: inline-flex;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 4px;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.mode-toggle:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.mode-toggle input[type="radio"] {
    display: none;
}

.mode-label {
    position: relative;
    z-index: 2;
    padding: 12px 24px;
    margin: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: #6c757d;
    transition: all 0.3s ease;
    border-radius: 20px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.mode-label:hover {
    color: #0d6efd;
}

.mode-toggle input[type="radio"]:checked + .mode-label {
    color: #ffffff;
    background: transparent;
}

.mode-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #0d6efd, #0dcaf0);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.mode-toggle input[type="radio"]:checked:last-of-type ~ .mode-slider {
    transform: translateX(100%);
}

/* =============================================================================
   Mode Questions Styling
   ============================================================================= */

.mode-questions {
    transition: all 0.5s ease-in-out;
    opacity: 1;
    transform: translateY(0);
}

.mode-questions.hidden {
    display: none !important;
}

.expert-divider {
    margin: 3rem 0 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border-left: 4px solid #0d6efd;
    text-align: center;
}

.expert-title {
    color: #0d6efd;
    font-weight: 700;
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expert-title i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* =============================================================================
   Expert Additional Content Styling
   ============================================================================= */

.architecture-diagram,
.detailed-recommendations,
.expert-analysis {
    background: #ffffff;
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.diagram-title,
.recommendations-title,
.analysis-title {
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
}

.diagram-title i,
.recommendations-title i,
.analysis-title i {
    color: #0d6efd;
    margin-right: 0.5rem;
    font-size: 1.3rem;
}

.diagram-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 2rem;
}

.recommendations-list {
    display: grid;
    gap: 1rem;
}

.recommendation-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
    transition: all 0.3s ease;
}

.recommendation-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.recommendation-item i {
    color: #0d6efd;
    font-size: 1.2rem;
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.recommendation-content {
    flex: 1;
}

.recommendation-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.recommendation-desc {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.analysis-content {
    line-height: 1.6;
    color: #495057;
}

.analysis-content p {
    margin-bottom: 1rem;
}

.analysis-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.analysis-content li {
    margin-bottom: 0.5rem;
}

/* =============================================================================
   Architecture Diagram Styling
   ============================================================================= */

.architecture-diagram-svg {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    width: 100%;
}

.arch-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.arch-component {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    min-width: 120px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.arch-component:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #0d6efd;
}

.arch-component i {
    font-size: 2rem;
    color: #0d6efd;
    margin-bottom: 0.5rem;
}

.arch-component span {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.arch-component.load-balancer {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-color: #17a2b8;
}

.arch-component.load-balancer i {
    color: #17a2b8;
}

.arch-component.web-app {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
}

.arch-component.web-app i {
    color: #28a745;
}

.arch-component.database {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
}

.arch-component.database i {
    color: #dc3545;
}

.arch-component.cache {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffc107;
}

.arch-component.cache i {
    color: #ffc107;
}

.arch-component.storage {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    border-color: #6c757d;
}

.arch-component.storage i {
    color: #6c757d;
}

/* 연결선 (선택적) */
.arch-row:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 1.5rem;
    background: #dee2e6;
}

.arch-component::before {
    content: '';
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 1.5rem;
    background: #dee2e6;
    opacity: 0;
}

.arch-row:first-child .arch-component::before {
    display: none;
}

/* =============================================================================
   Form Styling - 기존 스타일과 일관성 유지
   ============================================================================= */

/* Form Groups with enhanced spacing */
.form-group {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 15px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-group:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Form Labels with icons */
.form-label {
    color: #495057;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.form-label i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* =============================================================================
   Radio Button Styling
   ============================================================================= */

.form-check {
    padding: 1rem;
    background: #ffffff;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: flex-start;
}

.form-check:hover {
    border-color: #0d6efd;
    box-shadow: 0 3px 10px rgba(13, 110, 253, 0.1);
    transform: translateY(-2px);
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.1rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    z-index: 2;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    background-color: #ffffff;
    outline: none;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    background-size: 12px 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.form-check-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-check-input:checked + .form-check-label {
    color: #0d6efd;
    font-weight: 600;
}

.form-check-input:checked ~ .form-check::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(13, 202, 240, 0.05) 100%);
    z-index: -1;
}

.form-check-label {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.4;
    position: relative;
    z-index: 1;
    flex: 1;
    margin: 0;
}

.form-check-label small {
    display: block;
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.85rem;
}

/* 카드 전체 클릭 가능하도록 개선 */
.form-check {
    user-select: none;
}

.form-check:active {
    transform: translateY(-1px);
}

/* 선택된 상태 스타일 개선 */
.form-check-input:checked + .form-check-label {
    color: #0d6efd;
    font-weight: 600;
}

.form-check-input:checked ~ .form-check {
    border-color: #0d6efd;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.02) 0%, rgba(13, 202, 240, 0.02) 100%);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.15);
}


/* =============================================================================
   Card Enhancements
   ============================================================================= */

.card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

.card-header {
    border-radius: 20px 20px 0 0 !important;
    border: none;
    padding: 1.5rem 2rem;
    font-weight: 600;
}

.card-body {
    padding: 2rem;
}

/* =============================================================================
   Result Section Styling
   ============================================================================= */

#result-section {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Score Display */
.score-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 1rem 0;
    border: 2px solid #dee2e6;
}

#totalScore {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* =============================================================================
   Recommendation Card Styling
   ============================================================================= */

.recommendation-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Spec Card */
.spec-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    height: 100%;
}

.spec-title {
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.spec-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.spec-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
    transition: all 0.3s ease;
}

.spec-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.spec-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Cloud Card */
.cloud-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    height: 100%;
}

.cloud-title {
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.cloud-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cloud-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.cloud-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.cloud-rank {
    background: linear-gradient(135deg, #0d6efd, #0dcaf0);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-right: 1rem;
    min-width: 60px;
    text-align: center;
}

.cloud-info {
    flex: 1;
}

.cloud-link {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.cloud-link:hover {
    color: #0a58ca;
    text-decoration: none;
}

.cloud-link i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* =============================================================================
   Description and Next Steps Styling
   ============================================================================= */

.service-description,
.next-steps {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #198754;
    margin-bottom: 1rem;
}

.description-title,
.steps-title {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.description-title i,
.steps-title i {
    color: #198754;
    margin-right: 0.5rem;
}

.description-text,
.steps-text {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* =============================================================================
   CTA Section Styling
   ============================================================================= */

.cta-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid #dee2e6;
}

/* =============================================================================
   AdSense Section Styling
   ============================================================================= */

.adsense-section {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.adsense-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 1rem;
}

.adsense-container ins {
    max-width: 100%;
    height: auto;
}

.btn-lg {
    border-radius: 15px;
    font-weight: 600;
    padding: 0.75rem 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-lg:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-lg:active {
    transform: translateY(-1px);
}

/* Button Ripple Effect */
.btn-lg::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-lg:active::before {
    width: 300px;
    height: 300px;
}

/* =============================================================================
   Animation Classes
   ============================================================================= */

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

.bounce-in {
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* =============================================================================
   Responsive Design
   ============================================================================= */

@media (max-width: 768px) {
    .form-group {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .card-header {
        padding: 1rem 1.5rem;
    }
    
    .recommendation-card {
        padding: 1.5rem;
    }
    
    .spec-card,
    .cloud-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .score-display {
        padding: 1.5rem;
    }
    
    #totalScore {
        font-size: 2.5rem;
    }
    
    .btn-lg {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .cta-section .btn-lg {
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }
    
    /* Mode Toggle Mobile */
    .mode-toggle {
        width: 100%;
        max-width: 300px;
    }
    
    .mode-label {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    /* Expert Content Mobile */
    .architecture-diagram,
    .detailed-recommendations,
    .expert-analysis {
        padding: 1.5rem;
    }
    
    .diagram-container {
        min-height: 150px;
        padding: 1rem;
    }
    
    .recommendation-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .recommendation-item i {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    #totalScore {
        font-size: 2rem;
    }
    
    .form-check {
        padding: 0.75rem;
    }
    
    .form-check-label {
        font-size: 0.9rem;
    }
    
    .cloud-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cloud-rank {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* =============================================================================
   Loading States
   ============================================================================= */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =============================================================================
   Success/Error States
   ============================================================================= */

.form-control.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.94-.94 1.88 1.88 3.5-3.5.94.94-4.44 4.44z'/%3e%3c/svg%3e");
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 1.4 1.4 1.4-1.4'/%3e%3c/svg%3e");
}

/* =============================================================================
   Custom Utilities
   ============================================================================= */

.text-gradient {
    background: linear-gradient(45deg, #0d6efd, #0dcaf0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(45deg, #0d6efd, #0dcaf0) 1;
}

/* =============================================================================
   Print Styles
   ============================================================================= */

@media print {
    .btn,
    .cta-section {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    #totalScore {
        color: #000 !important;
    }
    
    .cloud-link {
        color: #000 !important;
        text-decoration: underline !important;
    }
}
