@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Oswald:wght@700&family=Roboto:wght@400;500;700&display=swap');

:root {
    --gold: #c9a227;
    --deep-red: #b22234;
    --near-black: #1a1a1a;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --dark-gray: #333333;
    --border-gray: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    background: linear-gradient(135deg, var(--near-black) 0%, #2a2a2a 100%);
    color: var(--white);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
}

/* Navigation */
nav {
    background: linear-gradient(90deg, var(--near-black) 0%, #222 100%);
    border-bottom: 3px solid var(--gold);
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

nav .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    font-family: 'Oswald', sans-serif;
    letter-spacing: 1px;
}

.badge {
    background: var(--deep-red);
    color: var(--white);
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

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

main.container {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Grid Layout */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.col-lg-6 {
    flex: 1 1 100%;
    max-width: 100%;
}

.col-lg-8 {
    flex: 1 1 100%;
    max-width: 100%;
}

.col-lg-12 {
    flex: 1 1 100%;
    max-width: 100%;
}

@media (min-width: 992px) {
    .col-lg-6 {
        flex: 0 1 50%;
        padding-right: 0.75rem;
    }

    .col-lg-6:last-child {
        padding-left: 0.75rem;
        padding-right: 0;
    }

    .col-lg-8 {
        flex: 0 1 66.666%;
    }

    .col-lg-12 {
        flex: 0 1 100%;
    }
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Side-by-side layout */
.layout-sidebyside {
    align-items: flex-start;
    gap: 1.5rem;
}

.layout-column-left,
.layout-column-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.layout-mobile-placeholder {
    display: block;
}

@media (min-width: 992px) {
    .layout-mobile-placeholder {
        display: none;
    }
}

@media (max-width: 991px) {
    .layout-sidebyside {
        flex-direction: column;
    }

    .layout-column-left::after {
        content: "↓";
        display: block;
        text-align: center;
        color: var(--gold);
        font-size: 1.5rem;
        margin: 1rem 0;
        opacity: 0.5;
    }
}

/* Cards */
.card {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(201, 162, 39, 0.2);
}

.card.border-danger {
    border-color: var(--deep-red) !important;
    border-width: 2px;
}

.card-header {
    background: linear-gradient(90deg, #333 0%, #2a2a2a 100%);
    border-bottom: 2px solid var(--gold);
    padding: 1rem;
    font-weight: 700;
    color: var(--gold);
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.5px;
}

.card-header.bg-light {
    background: #2a2a2a !important;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    margin-bottom: 1rem;
}

.card-text {
    color: #ccc;
    margin-bottom: 1rem;
}

/* Text Utilities */
.text-muted {
    color: #999 !important;
}

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

.small {
    font-size: 0.875rem;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
    gap: 1rem;
}

.d-md-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-md-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.flex-grow-1 {
    flex-grow: 1;
}

/* Spacing */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.my-5 { margin-top: 3rem; margin-bottom: 3rem; }

.ms-2 { margin-left: 1rem; }

.p-0 { padding: 0; }
.p-3 { padding: 1.5rem; }

.pb-3 { padding-bottom: 1.5rem; }

.h1 { font-size: 2rem; }
.h5 { font-size: 1.25rem; font-weight: 700; }
.h6 { font-size: 1.1rem; font-weight: 700; }

/* Forms */
textarea,
input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 0.75rem;
    background: #333;
    border: 2px solid #555;
    border-radius: 6px;
    color: var(--white);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

textarea::placeholder,
input::placeholder {
    color: #777;
}

textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: #333;
    border: 2px solid #555;
    border-radius: 6px;
    color: var(--white);
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

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

.form-range {
    height: 0.5rem;
    background: #555;
    border-radius: 4px;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
    transition: all 0.3s ease;
}

.form-range::-webkit-slider-thumb:active {
    box-shadow: 0 0 0 6px rgba(201, 162, 39, 0.3);
}

.form-range::-moz-range-thumb {
    width: 1.25rem;
    height: 1.25rem;
    background: var(--gold);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
    transition: all 0.3s ease;
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    background: #333;
    border: 2px solid #555;
    border-radius: 6px;
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

.form-select option {
    background: #333;
    color: var(--white);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    background: #333;
    border: 2px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
}

.form-check-input:hover {
    border-color: var(--gold);
}

.form-check-input:checked {
    background: var(--gold);
    border-color: var(--gold);
}

.form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    user-select: none;
}

.btn-danger {
    background: linear-gradient(90deg, var(--deep-red) 0%, #9b1a2a 100%);
    color: var(--white);
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.btn-danger:hover {
    background: linear-gradient(90deg, #8b1624 0%, #7b121d 100%);
    box-shadow: 0 8px 20px rgba(178, 34, 52, 0.4);
    transform: translateY(-2px);
}

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

.btn-secondary {
    background: #555;
    color: var(--white);
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.btn-secondary:hover {
    background: #666;
    transform: translateY(-2px);
}

.btn-lg {
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
}

.btn-sm {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.btn-link {
    background: none;
    color: var(--gold);
    text-decoration: none;
    padding: 0;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
}

.btn-link:hover {
    color: #f0c850;
    text-decoration: underline;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
}

.btn-outline-primary:hover {
    background: var(--gold);
    color: var(--near-black);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid;
    margin-bottom: 1rem;
}

.alert-info {
    background: rgba(201, 162, 39, 0.1);
    border-color: var(--gold);
    color: #ccc;
}

/* Border utility */
.border-bottom {
    border-bottom: 1px solid #444;
}

.bg-light {
    background: #2a2a2a !important;
    color: var(--white) !important;
}

/* Output styling */
#outputText {
    background: #333;
    padding: 1.5rem;
    border-radius: 6px;
    border: 2px solid var(--gold);
    font-size: 1.1rem;
    line-height: 1.8;
    word-break: break-word;
    white-space: pre-wrap;
    min-height: 80px;
    color: var(--gold);
}

#outputSection {
    border: 2px solid var(--gold) !important;
}

/* Character count */
#charCount {
    color: var(--gold);
    font-weight: 700;
}

/* Examples */
.example-item {
    background: #333;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--gold);
    margin: 1rem 0;
}

.example-item p {
    color: #ccc;
    margin-bottom: 0.5rem;
}

.example-item strong {
    color: var(--gold);
}

/* Intensity value display */
#intensityValue {
    color: var(--gold);
    font-weight: 700;
    font-size: 1.2rem;
}

/* Changes list */
#changesList {
    padding-left: 1.5rem;
    color: #ccc;
}

#changesList li {
    margin-bottom: 0.75rem;
}

/* Footer */
footer {
    background: linear-gradient(90deg, var(--near-black) 0%, #222 100%);
    border-top: 3px solid var(--gold);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    color: #999;
}

footer p {
    margin: 0;
}

footer a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #f0c850;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .col-lg-8 {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .d-md-flex {
        flex-direction: column;
    }

    .d-grid {
        grid-template-columns: 1fr !important;
    }

    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    main.container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: 1.5rem;
    }

    nav .navbar-brand {
        font-size: 1.25rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .card,
    .btn,
    textarea,
    .form-range {
        transition: none !important;
    }
}

/* Outline for focus visible */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
