/* Estimator Section */
.estimator-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 90vh;
}

.estimator-header {
    text-align: center;
    margin-bottom: 3rem;
}

.estimator-header h1 {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: white;
    color: #f97316;
    /* FPT Orange */
    border: 2px solid #f97316;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-home i {
    transition: transform 0.3s ease;
}

.btn-home:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
    border-color: transparent;
}

.btn-home:hover i {
    transform: translateX(-3px);
}

.btn-home:active {
    transform: translateY(0);
}

.estimator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .estimator-grid {
        grid-template-columns: 1fr;
    }
}

/* Controls */
.control-group {
    margin-bottom: 2rem;
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #4a5568;
}

.toggle-group {
    display: flex;
    gap: 1rem;
}

.toggle-group input[type="radio"] {
    display: none;
}

.toggle-btn {
    flex: 1;
    text-align: center;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-group input:checked+.toggle-btn {
    border-color: #f97316;
    /* FPT Orange */
    background: #fff7ed;
    color: #f97316;
}

.custom-range {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #f97316;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4);
}

.btn-calculate {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(90deg, #f97316, #ea580c);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.btn-calculate:hover {
    transform: translateY(-2px);
}

/* Add-ons */
.addons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.addon-card input {
    display: none;
}

.addon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

.addon-content i {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    display: block;
}

.addon-card input:checked+.addon-content {
    border-color: #f97316;
    background: #fff7ed;
    color: #f97316;
}

/* Visualizer */
/* Visualizer - 3D Isometric Update */
.estimator-visualizer {
    background: #eef2ff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 450px;
    position: relative;
    overflow: hidden;
    perspective: 1200px;
    /* Deep 3D perspective */
}

.visualizer-container {
    position: relative;
    width: 220px;
    display: flex;
    flex-direction: column-reverse;
    /* Stack from bottom up */
    align-items: center;
    transform-style: preserve-3d;
    transform: rotateY(-25deg) rotateX(10deg);
    /* Isometric-ish Viewing Angle */
    transition: transform 0.5s ease;
    margin-top: 50px;
    /* Make space for roof */
}

/* Floor Blocks - 3D Box Construction */
.floor {
    width: 150px;
    height: 70px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
    margin-bottom: -1px;
    /* Prevent gaps */
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy pop-in */
    animation: floor-pop 0.5s ease-out forwards;
}

@keyframes floor-pop {
    from {
        opacity: 0;
        transform: translateZ(-50px) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateZ(0) scale(1);
    }
}

/* Right Face (Depth) */
.floor::after {
    content: '';
    position: absolute;
    right: -25px;
    /* Width of side */
    top: 0;
    width: 25px;
    height: 100%;
    background: #cbd5e1;
    transform-origin: left;
    transform: rotateY(90deg);
    border-left: 1px solid #94a3b8;
}

/* Window Style for Upper Floors */
.floor:not(.ground) {
    background: #fff;
    /* Base wall color */
}

/* Windows using ::before */
.floor:not(.ground)::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 15px;
    right: 15px;
    bottom: 15px;
    /* Window Pane Gradient */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.8) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.8) 2px, transparent 2px),
        linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    background-size: 58px 100%, 58px 100%, 100% 100%;
    border: 3px solid #bfdbfe;
    border-radius: 4px;
    box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.3);
}

/* Ground Floor - Entrance */
.ground {
    height: 80px;
    /* Taller for door */
    background: #f1f5f9;
    border-bottom: 8px solid #64748b;
    /* Foundation */
}

/* Ground Side Face extension */
.ground::after {
    background: #94a3b8;
    border-bottom: 8px solid #475569;
}

/* Door on Ground Floor */
.ground::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 40px;
    height: 55px;
    background: linear-gradient(to bottom, #475569, #334155);
    border: 4px solid #fff;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Roof - 3D Pyramid Prism Approach */
.roof {
    position: relative;
    width: 150px;
    height: 80px;
    margin-bottom: -1px;
    transform-style: preserve-3d;
    z-index: 10;
    transition: all 0.5s ease;
}

/* Front Triangle of Roof */
.roof-front {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border-left: 75px solid transparent;
    border-right: 75px solid transparent;
    border-bottom: 80px solid #ef4444;
    transform: translateZ(12.5px);
    /* Push front half of depth */
}

/* The Sloped Side (A bit complex in pure CSS, simpler to use a flat roof logic with rotation) */
/* Let's simulate a 3D Roof using skew and rotations on pseudo elements */
.roof {
    /* Reset from previous */
    width: 0;
    height: 0;
    border: none;
    /* Create a container */
    width: 150px;
    height: 80px;
    background: transparent;
}

.roof::before {
    /* Left Slope/Front Face */
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 75px solid transparent;
    border-right: 75px solid transparent;
    border-bottom: 80px solid #ef4444;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.1));
    transform: translateZ(1px);
    /* Make sure it's in front */
}

.roof::after {
    /* Right Slope/Side Face - The 3D part */
    content: '';
    position: absolute;
    bottom: 0;
    right: -25px;
    /* Offset by depth */
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    /* Skew logic */
    border-bottom: 80px solid #b91c1c;
    /* Darker red */
    transform-origin: bottom left;
    transform: skewX(-18deg);
    /* Approximate the side slope */
    /* This is a hacky 2.5D Roof. */
}


/* Office Style Overrides */
.building-base.office .roof {
    height: 25px;
    background: transparent;
}

.building-base.office .roof::before {
    /* Flat Roof Front */
    border: none;
    width: 150px;
    height: 25px;
    background: #334155;
    border-bottom: 4px solid #1e293b;
}

.building-base.office .roof::after {
    /* Flat Roof Side */
    border: none;
    transform: none;
    width: 25px;
    height: 25px;
    right: -25px;
    background: #1e293b;
    border-bottom: 4px solid #0f172a;
}

.building-base.office .floor {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.building-base.office .floor:not(.ground)::before {
    /* Glass Curtain Wall Style */
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
    background-size: 100% 20px;
    background-color: #94a3b8;
    border: 1px solid #64748b;
}

/* Wifi Animation - Correct 3D Position */
.wifi-waves {
    position: absolute;
    top: -100px;
    /* Higher up */
    left: 50%;
    transform: translateX(-50%) translateZ(50px) rotateY(25deg);
    /* Counter-rotate to face user somewhat? */
    z-index: 20;
    pointer-events: none;
}

.wifi-waves span {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(60deg);
    /* Flat rings */
    border: 4px solid #0ea5e9;
    /* Thicker */
    border-radius: 50%;
    animation: wifi-pulse 2s infinite ease-out;
    opacity: 0;
    box-shadow: 0 0 10px #0ea5e9;
}

.wifi-waves span:nth-child(1) {
    width: 30px;
    height: 30px;
    animation-delay: 0s;
}

.wifi-waves span:nth-child(2) {
    width: 60px;
    height: 60px;
    animation-delay: 0.5s;
    margin-top: 0;
}

.wifi-waves span:nth-child(3) {
    width: 90px;
    height: 90px;
    animation-delay: 1.0s;
    margin-top: 0;
}

@keyframes wifi-pulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotateX(60deg) scale(0.5);
    }

    20% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotateX(60deg) scale(1.5);
    }
}

/* Results */
.recommendation-section {
    margin-top: 3rem;
    text-align: center;
}

.hidden {
    display: none !important;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.package-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 2px solid #e2e8f0;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.package-card.recommended {
    border-color: #f97316;
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(249, 115, 22, 0.1);
}

.package-card.recommended::before {
    content: 'Phù Hợp Nhất';
    position: absolute;
    top: 25px;
    right: -40px;
    background: #f97316;
    color: white;
    padding: 5px 40px;
    transform: rotate(45deg);
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
}

.card-speed {
    font-size: 2.5rem;
    font-weight: 900;
    color: #0ea5e9;
    margin: 1rem 0;
}

.card-price {
    font-size: 1.25rem;
    color: #64748b;
    font-weight: 600;
}

.btn-select {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin-top: 1.5rem;
    background: #f1f5f9;
    color: #334155;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.package-card.recommended .btn-select {
    background: #f97316;
    color: white;
}

.btn-select:hover {
    opacity: 0.9;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}/ *   S p e e d   D i s p l a y   R e f i n e m e n t   * /  
 . s p e e d - d u a l   {  
         d i s p l a y :   f l e x ;  
         a l i g n - i t e m s :   c e n t e r ;  
         j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ;  
         b a c k g r o u n d :   # f 8 f a f c ;  
         b o r d e r - r a d i u s :   1 2 p x ;  
         p a d d i n g :   0 . 8 r e m ;  
         m a r g i n :   1 r e m   0 ;  
         b o r d e r :   1 p x   s o l i d   # e 2 e 8 f 0 ;  
 }  
  
 . s p e e d - i t e m   {  
         d i s p l a y :   f l e x ;  
         a l i g n - i t e m s :   c e n t e r ;  
         g a p :   0 . 8 r e m ;  
         f l e x :   1 ;  
 }  
  
 . s p e e d - d e t a i l   {  
         d i s p l a y :   f l e x ;  
         f l e x - d i r e c t i o n :   c o l u m n ;  
         a l i g n - i t e m s :   f l e x - s t a r t ;  
 }  
  
 . s p e e d - l a b e l   {  
         f o n t - s i z e :   0 . 7 5 r e m ;  
         c o l o r :   # 6 4 7 4 8 b ;  
         f o n t - w e i g h t :   6 0 0 ;  
         t e x t - t r a n s f o r m :   u p p e r c a s e ;  
 }  
  
 . s p e e d - v a l   {  
         f o n t - s i z e :   1 . 1 r e m ;  
         f o n t - w e i g h t :   8 0 0 ;  
         c o l o r :   # 3 3 4 1 5 5 ;  
         l i n e - h e i g h t :   1 . 2 ;  
 }  
  
 . s p e e d - d i v i d e r   {  
         w i d t h :   1 p x ;  
         h e i g h t :   3 0 p x ;  
         b a c k g r o u n d :   # c b d 5 e 1 ;  
         m a r g i n :   0   1 r e m ;  
 }  
  
 . t e x t - o r a n g e   {  
         c o l o r :   # f 9 7 3 1 6 ;  
         f o n t - s i z e :   1 . 2 r e m ;  
 }  
  
 . t e x t - b l u e   {  
         c o l o r :   # 3 b 8 2 f 6 ;  
         f o n t - s i z e :   1 . 2 r e m ;  
 }  
  
 . t e x t - w a r n i n g   {  
         c o l o r :   # f 5 9 e 0 b ;  
 }  
  
 / *   E n h a n c i n g   S i n g l e   S p e e d   D i s p l a y   t o o   * /  
 . c a r d - s p e e d   {  
         b a c k g r o u n d :   # f 0 f d f 4 ;  
         / *   L i g h t   g r e e n   t i n t   * /  
         b o r d e r - r a d i u s :   1 2 p x ;  
         p a d d i n g :   0 . 8 r e m ;  
         m a r g i n :   1 r e m   0 ;  
         c o l o r :   # 1 6 6 5 3 4 ;  
         d i s p l a y :   f l e x ;  
         a l i g n - i t e m s :   c e n t e r ;  
         j u s t i f y - c o n t e n t :   c e n t e r ;  
         f o n t - w e i g h t :   9 0 0 ;  
         f o n t - s i z e :   1 . 8 r e m ;  
         / *   M a k e   i t   p o p   * /  
         b o r d e r :   1 p x   s o l i d   # b b f 7 d 0 ;  
 }  
 