@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Poppins:wght@400;500;600&display=swap');

:root {
    --primary-color: #00ADB5;
    --secondary-color: #393E46;
    --background-light: #F9F9F9;
    --text-dark: #222831;
    --text-light: #EEEEEE;
    --card-bg: #FFFFFF;
    --border-color: #E0E6E9;
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.07);
    --border-radius: 16px;
    --transition-speed: 0.3s ease-out;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-light);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding: 30px 20px;
    transition: background-color var(--transition-speed);
}

body.dark-mode {
    --primary-color: #00E6E6;
    --secondary-color: #A3A8AF;
    --background-light: #121212;
    --text-dark: #EEEEEE;
    --text-light: #222831;
    --card-bg: #222831;
    --border-color: #393E46;
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body.dark-mode .hero-header {
    background: linear-gradient(45deg, #00818A 0%, #005A61 100%);
}
body.dark-mode .hero-header .title,
body.dark-mode .hero-header .tagline {
    color: var(--text-dark);
}
body.dark-mode .main-content h2 {
    color: var(--text-dark);
}
body.dark-mode .search-input {
    background-color: #333;
    color: var(--text-dark);
    border-color: #555;
}
body.dark-mode .search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 173, 181, 0.2);
}
body.dark-mode .service-card {
    border-color: var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    background-color: var(--card-bg);
}
body.dark-mode .service-card:hover {
    border-color: var(--primary-color);
}
body.dark-mode .service-card .title {
    color: var(--primary-color);
}
body.dark-mode .service-card .description {
    color: var(--secondary-color);
}
body.dark-mode .service-card .icon {
    color: var(--primary-color);
}
body.dark-mode .service-card .serial-number {
    color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.08);
}
body.dark-mode .service-card:hover .serial-number {
    background-color: var(--primary-color);
    color: var(--text-light);
}
body.dark-mode .footer a {
    color: var(--primary-color);
}
body.dark-mode .footer a:hover {
    color: var(--text-dark);
}

.container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-header {
    text-align: center;
    padding: 40px 25px;
    background: linear-gradient(45deg, var(--primary-color) 0%, #17A2B8 100%);
    color: var(--text-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-subtle);
    position: relative;
    overflow: hidden;
}

.hero-header::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.05);
    transform: rotate(-30deg);
    z-index: 0;
}

.home-link {
    text-decoration: none;
    color: inherit;
}

.hero-header .title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.5em, 6vw, 3.5em);
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.hero-header .tagline {
    font-size: clamp(1em, 2.5vw, 1.25em);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.main-content {
    padding: 0;
}

.calculator-card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-subtle);
    text-align: left;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    color: var(--text-dark);
    background-color: var(--background-light);
    transition: all var(--transition-speed);
}

body.dark-mode .form-group input[type="text"] {
    background-color: #333;
    color: var(--text-dark);
    border-color: #555;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 173, 181, 0.2);
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform 0.2s ease;
}

.calculate-btn:hover {
    background-color: #00818A;
    transform: translateY(-2px);
}

.share-btn {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.share-btn i {
    font-size: 1.2em;
}

.result-summary {
    display: none;
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-subtle);
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}

.result-summary::before {
    content: none;
}

.result-header {
    position: relative;
    z-index: 1;
}

.result-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.result-subtitle {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.trimester-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.trimester-stage {
    flex: 1;
    min-width: 150px;
    text-align: center;
    background-color: var(--background-light);
    padding: 15px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed);
}

.trimester-stage h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2em;
    font-weight: 700; /* DIBUAT TEBAL */
    color: var(--primary-color);
    margin-bottom: 5px;
}

.trimester-stage p {
    font-size: 0.9em;
    color: var(--secondary-color);
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 25px;
    background-color: var(--secondary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition-speed);
    text-align: center;
}

.back-link:hover {
    background-color: #2e353f;
    transform: translateY(-2px);
}

/* jQuery UI Datepicker styling override */
.ui-datepicker {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9em;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-subtle);
}

.ui-datepicker-header {
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.ui-datepicker-title {
    color: var(--text-light);
}

.ui-datepicker-prev, .ui-datepicker-next {
    color: var(--text-light);
    transition: all var(--transition-speed);
    cursor: pointer;
}

.ui-datepicker-prev:hover, .ui-datepicker-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: transparent;
}

.ui-state-highlight, .ui-state-active, .ui-state-hover {
    background: var(--primary-color) !important;
    color: var(--text-light) !important;
    border-radius: 50% !important;
    font-weight: 600 !important;
}

.ui-widget-header .ui-icon {
    background-image: none !important;
    color: var(--text-light);
}

@media (max-width: 600px) {
    .hero-header { padding: 30px 20px; }
    .hero-header .title { font-size: 2em; }
    .hero-header .tagline { font-size: 0.9em; }
    .main-content h2 { font-size: 1.6em; }
    .trimester-info {
        flex-direction: column;
    }
}