/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a3a5c;
    --secondary-color: #c9a227;
    --accent-color: #2c5f8a;
    --text-color: #333;
    --light-bg: #f5f7fa;
    --white: #ffffff;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}

/* Navigation */
header {
    background-color: var(--primary-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .nav,
nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: var(--secondary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    text-align: center;
    padding: 4rem 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Calculator Section */
.calculator {
    max-width: 800px;
    margin: -3rem auto 2rem;
    padding: 2rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.input-group {
    text-align: center;
}

.input-group label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.input-group input[type="text"] {
    padding: 1.2rem 2rem;
    font-size: 1.8rem;
    border: 3px solid #ddd;
    border-radius: 10px;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 450px;
    color: var(--text-color);
    text-align: center;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 138, 0.2);
}

.input-group input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-color);
}

.input-group button {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    padding: 1.2rem 3rem;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1rem;
}

.input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.4);
}

.date-format-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
}

.error-message {
    font-size: 0.9rem;
    color: var(--danger);
    margin-bottom: 0.5rem;
    min-height: 1.2rem;
}

/* Countdown Display */
.countdown-boxes {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.countdown-box {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    padding: 1.5rem 2rem;
    border-radius: 10px;
    min-width: 120px;
    text-align: center;
}

.countdown-box .number {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
}

.countdown-box .label {
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
    opacity: 0.9;
}

.message {
    text-align: center;
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 500;
    margin-top: 1rem;
}

/* Milestones */
#milestones h2 {
    text-align: center;
    color: var(--primary-color);
    margin: 2rem 0 1.5rem;
}

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

.milestone {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.milestone-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.milestone-content {
    flex: 1;
}

.milestone-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.milestone-content p {
    font-size: 0.95rem;
    color: #666;
}

.milestone-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 100px;
    text-align: center;
}

.milestone-status.pending {
    background: var(--warning);
    color: #333;
}

.milestone-status.completed {
    background: var(--success);
    color: var(--white);
}

.milestone-status.upcoming {
    background: var(--accent-color);
    color: var(--white);
}

/* Embed Section */
#embed-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

#embed-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

#embed-code {
    width: 100%;
    height: 80px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 1rem;
}

#copy-embed {
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#copy-embed:hover {
    background-color: var(--primary-color);
}

/* Info Content */
.info-content {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.info-content h2 {
    color: var(--primary-color);
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.info-content h2:first-child {
    margin-top: 0;
}

.info-content h3 {
    color: var(--accent-color);
    margin: 1.5rem 0 0.8rem;
    font-size: 1.2rem;
}

.info-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.info-content ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.info-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 3rem 2rem 1.5rem;
    margin-top: 3rem;
}

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

.footer-section h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.disclaimer {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .calculator {
        margin: -2rem 1rem 2rem;
        padding: 1.5rem;
    }

    .countdown-boxes {
        gap: 1rem;
    }

    .countdown-box {
        min-width: 100px;
        padding: 1rem 1.5rem;
    }

    .countdown-box .number {
        font-size: 2.2rem;
    }

    .milestone {
        flex-direction: column;
        text-align: center;
    }

    .milestone-icon {
        margin-bottom: 0.5rem;
    }

    .info-content {
        margin: 2rem 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .input-group input[type="text"] {
        font-size: 1.3rem;
        padding: 1rem 1.5rem;
        max-width: 100%;
    }

    .input-group button {
        width: 100%;
    }

    .countdown-box {
        min-width: 80px;
        padding: 0.8rem 1rem;
    }

    .countdown-box .number {
        font-size: 1.8rem;
    }

    .countdown-box .label {
        font-size: 0.75rem;
    }
}

/* Tool Section */
.main {
    padding: 2rem 0;
    display: flex;
    justify-content: center;
}

.tool-section {
    padding: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

.tool-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

/* Card */
.card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Time Converter */
.converter-card {
    text-align: center;
}

.time-display {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.time-label {
    font-size: 0.9rem;
    opacity: 0.9;
    display: block;
    margin-bottom: 0.5rem;
}

.time-value {
    font-size: 3rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
}

.time-format {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: 0.5rem;
    display: block;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 2rem;
}

.converter-panel h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.converter-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 3rem;
}

.divider-text {
    background: var(--light-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    color: #666;
}

.time-input-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.time-input-group select {
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    min-width: 70px;
}

.time-input-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.time-separator {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.4);
}

.btn-secondary {
    background: var(--accent-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--primary-color);
}

.result-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 8px;
}

.result-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

/* Quick Reference */
.quick-converts {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.quick-converts h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.reference-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: var(--light-bg);
    border-radius: 6px;
}

.ref-military {
    font-weight: bold;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.ref-standard {
    color: #666;
}

/* Embed Section */
.embed-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    text-align: left;
}

.embed-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.embed-code-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.embed-code {
    flex: 1;
    padding: 1rem;
    background: var(--light-bg);
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.copy-btn {
    white-space: nowrap;
}

/* Content Section */
.content-section {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    margin-top: 2rem;
}

.content-section h2 {
    color: var(--primary-color);
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.content-section h2:first-child {
    margin-top: 0;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.content-section ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.content-section li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* FAQ */
.faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}

.faq-item p {
    margin-bottom: 0.5rem;
}

/* Conversion Table */
.conversion-table {
    margin: 2rem 0;
}

.conversion-table h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.table-wrapper {
    overflow-x: auto;
}

.time-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.time-table th,
.time-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.time-table th {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

.time-table tr:hover {
    background: var(--light-bg);
}

/* Form Elements */
.select-full {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
}

.select-full:focus {
    outline: none;
    border-color: var(--accent-color);
}

.input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.input-field {
    flex: 1;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-color);
}

.select-small {
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    min-width: 120px;
}

.full-width {
    width: 100%;
}

/* Size Result */
.size-result {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    color: var(--white);
}

.size-result.hidden {
    display: none;
}

.result-header h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    opacity: 0.9;
}

.size-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.size-main {
    text-align: center;
}

.size-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.size-value {
    display: block;
    font-size: 4rem;
    font-weight: bold;
    line-height: 1;
}

.size-details {
    display: flex;
    gap: 2rem;
}

.detail-item {
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0.3rem;
}

.detail-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Size Charts */
.size-charts {
    margin-top: 2rem;
}

.size-charts h3 {
    color: var(--primary-color);
    margin: 1.5rem 0 1rem;
    font-size: 1.1rem;
}

.size-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    margin-bottom: 1.5rem;
}

.size-table th,
.size-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.size-table th {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

.size-table tr:hover {
    background: var(--light-bg);
}

/* BAH Calculator */
.bah-form {
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.suggestions.hidden {
    display: none;
}

.suggestion-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: var(--light-bg);
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* BAH Result */
.bah-result {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    color: var(--white);
}

.bah-result.hidden {
    display: none;
}

.bah-result .result-header {
    margin-bottom: 1.5rem;
}

.bah-result .result-header h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.result-location {
    opacity: 0.9;
    font-size: 1rem;
}

.rate-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.rate-main {
    text-align: center;
}

.rate-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.rate-value {
    display: block;
    font-size: 3.5rem;
    font-weight: bold;
    line-height: 1;
}

.rate-details {
    display: flex;
    gap: 2rem;
}

.rate-item {
    text-align: center;
}

.rate-item-label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0.3rem;
}

.rate-item-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

@media (max-width: 768px) {
    .rate-display {
        flex-direction: column;
        text-align: center;
    }

    .rate-details {
        flex-wrap: wrap;
        justify-content: center;
    }

    .rate-value {
        font-size: 2.5rem;
    }
}

/* Pay Calculator */
.pay-form {
    margin-bottom: 2rem;
}

.pay-result {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    color: var(--white);
}

.pay-result.hidden {
    display: none;
}

.pay-result .result-header {
    margin-bottom: 1.5rem;
}

.pay-result .result-header h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.result-rank {
    opacity: 0.9;
    font-size: 1rem;
}

.pay-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.pay-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.pay-item.main-pay {
    background: rgba(255, 255, 255, 0.15);
}

.pay-item.allowance {
    background: rgba(255, 255, 255, 0.1);
}

.pay-item.total {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.pay-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.pay-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.pay-note {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .pay-breakdown {
        grid-template-columns: 1fr;
    }

    .pay-value {
        font-size: 1.5rem;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .size-display {
        flex-direction: column;
        text-align: center;
    }

    .size-details {
        flex-wrap: wrap;
        justify-content: center;
    }

    .converter-grid {
        grid-template-columns: 1fr;
    }

    .converter-divider {
        padding: 1rem 0;
    }
}
