:root {
    --max-width: 1200px;
    --primary-color: #FF9F00;
    --primary-dark: #CC7F00;
    --accent-color: #23A6A6;
    --text-dark: #222222;
    --text-medium: #3C4654;
    --text-light: #78888B;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-gray: #e9ecef;
    --border-color: #dee2e6;
    --border-bottom-color: #728AA0;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    --spacing: 0.25rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*:focus,
*:focus-visible {
    outline-color: var(--primary-color);
    outline-style: solid;
    outline-width: 2px;
    outline-offset: 2px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--text-medium);
    min-height: 100vh;
    padding: 10px 20px;
    color: var(--text-dark);
    font-size: 1.0em;
}

header {
    background: var(--bg-white);
    padding: 20px 20px 2px 20px;
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* This will be set dynamically by JavaScript */
header.random-border {
    border-bottom-color: var(--random-border-color);
}

header h1 {
    font-size: 2.0em;
    margin-bottom: 5px;
    color: var(--text-dark);
}

header h1 a {
    text-decoration: none;
    color: inherit;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.logo_imago {
    max-height: 70px;
}

.logo_logos {
    max-height: 60px;
}

.subtitle {
    font-size: 1.1em;
    color: var(--text-medium);
}

.language-switcher {
    font-size: 0.85em;
    text-align: right;
}

.language-switcher a {
    padding: 6px 12px;
    background: var(--bg-white);
    color: var(--text-dark);
    font-weight: 600;
    transition: all 0.2s ease;
}

.language-switcher a:hover {
    transform: translateY(-1px);
}

.language-switcher a.active {
    color: var(--primary-color);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    background: transparent;
}

section {
    border: none;
    display: block;
}

.tool-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
    box-shadow: var(--shadow-md);
}

.tool-section h2,
.color-picker-container h2,
.preview-section-inline h2  {
    font-size: 1.5em;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 3px;
    border-bottom: 2px solid var(--border-bottom-color);
}

/* Color Picker and Live Preview Wrapper */
.color-picker-preview-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}


.color-controls {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.color-input-group {
    flex: 1;
}

.color-input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-medium);
    font-size: 1em;
}

.color-input-set {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.color-bar {
    width: 60px;
    min-height: 130px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-bar:hover {
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

.color-format-inputs {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-text-input {
    width: 100%;
    padding: 3px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.8em;
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s ease;
}

.color-text-input:focus {
    border-color: var(--primary-color);
}

.invert-btn {
    width: 50px;
    height: 50px;
    background: var(--text-dark);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    align-self: center;
    margin-top: 35px;
}

.invert-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.preview-box {
    padding: 30px;
    border-radius: 12px;
    min-height: 200px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.preview-box h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
}

.preview-box p {
    font-size: 1.1em;
    line-height: 1.6;
}

/* Contrast Display */
.contrast-display {
    margin-bottom: 20px;
    padding: 5px 10px;
    background: var(--bg-light);
    border-radius: 12px;
}

.contrast-ratio-value {
    font-size: 2em;
    font-weight: 700;
    text-align: center;
    color: var(--text-dark);
    margin: 0 0 10px 0;
}

.contrast-bar-container {
    width: 100%;
    height: 30px;
    background: linear-gradient(to right, #dc3545, #ffc107, #28a745);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    margin: 10px 0;
}

.contrast-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.7);
    border-right: 3px solid var(--text-medium);
    transition: width 0.3s ease;
}

.contrast-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 1.2em;
    color: var(--text-light);
    margin-top: 5px;
}

.compliance-grid {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.compliance-header {
    font-weight: 700;
    color: var(--text-medium);
    padding: 10px;
    background: var(--bg-white);
    border-radius: 6px;
    text-align: center;
}

.compliance-label {
    font-weight: 600;
    color: var(--text-dark);
    padding: 10px;
}

.compliance-badge {
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s ease;
}

.compliance-badge.pass {
    background: var(--success-color);
    color: white;
}

.compliance-badge.fail {
    background: var(--danger-color);
    color: white;
}

/* Preview Section */
.preview-section {
    margin-bottom: 30px;
}

.preview-box {
    padding: 30px;
    border-radius: 12px;
    min-height: 160px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.preview-box h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
}

.preview-box p {
    font-size: 1.1em;
    line-height: 1.6;
}

/* Text Samples */
.text-samples-section {
    margin-bottom: 20px;
    padding: 5px 10px;
}

.size-unit-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0px;
}

.size-unit-selector label {
    font-weight: 600;
    color: var(--text-medium);
}

.size-unit-selector select {
    padding: 5px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.size-unit-selector select:focus {
    border-color: var(--primary-color);
}

.text-samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.text-sample {
    padding: 5px 10px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.text-sample-label {
    font-weight: 700;
    font-size: 0.85em;
    color: var(--text-medium);
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.text-sample-content {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.text-sample-content.large {
    font-size: 24px;
}

.text-sample-content.bold {
    font-weight: 700;
}

.text-sample-size {
    font-size: 0.85em;
    color: var(--text-light);
    font-style: italic;
}

/* Info Section */
.info-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
    box-shadow: var(--shadow-md);
}

.info-box {
    margin-bottom: 20px;
    padding: 20px 20px 3px 20px;
    background: var(--bg-light);
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    height: 100%;
}

.info-box:last-child {
    margin-bottom: 0;
}

.info-box h3 {
    font-size: 1.3em;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.info-box p {
    font-size: 1em;
    line-height: 1.4em;
    color: var(--text-medium);
    margin-block-end: 1em;
}

.info-box-content {
    display: flex;
    gap: 20px;
}

.info-box-img {
    text-align: center;
    align-items: center;
}

.info-box-img img {
    max-width: 200px;
}

.info-box-txt {
    text-align: left;
}

/* About & Terms Pages */
.about-section,
.terms-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 40px;
    margin-top: 20px;
    box-shadow: var(--shadow-md);
}

.about-section h1,
.contact-section h1,
.terms-section h1 {
    font-size: 2.5em;
    color: var(--text-dark);
    margin-bottom: 15px;
    text-align: center;
}

.about-content h2,
.terms-section h2 {
    font-size: 1.6em;
    color: var(--text-dark);
    margin: 30px 0 15px;
}

.about-content h3,
.terms-section h3 {
    font-size: 1.3em;
    color: var(--text-medium);
    margin: 20px 0 10px;
}

.about-content p,
.terms-section p {
    font-size: 1.05em;
    line-height: 1.8;
    color: var(--text-medium);
    margin-bottom: 15px;
}

.terms-section ul {
    margin: 15px 0 15px 40px;
    line-height: 1.8;
}

.terms-section li {
    margin-bottom: 8px;
    color: var(--text-medium);
}

.about-cta {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-top: 40px;
}

.about-cta p {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* Footer */
.footer {
    width: 100%;
    max-width: var(--max-width);
    margin: 30px auto 20px;
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 1em;
}

.footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--primary-color);
}

/* Ad Containers */
.xtra-hor,
.xtra-hor-top,
.xtra-hor-mid {
    width: 100%;
    max-width: var(--max-width);
    margin: 10px auto;
    padding: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Color Palette Section */
.palette-section {
    background: var(--bg-light);
    margin-bottom: 20px;
    padding: 5px 10px;
}

.palette-controls {
    display: flex;
    gap: 30px;
    margin: 15px 0px;
    flex-wrap: wrap;
}

.palette-control-group {
    flex: 1;
    min-width: 250px;
}

.palette-control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-medium);
}

.base-color-toggle {
    display: flex;
    gap: 15px;
    align-items: center;
}

.base-color-toggle input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.base-color-toggle label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

.palette-select {
    width: 100%;
    padding: 5px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.palette-select:focus {
    border-color: var(--primary-color);
}

.palette-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.palette-swatch {
    min-height: 160px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    position: relative;
    transition: transform 0.2s ease;
}

.palette-swatch:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.swatch-label {
    width: 100%;
    padding: 8px;
    font-size: 0.7em;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
    text-align: left;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.swatch-label.dark-text {
    background: rgba(0, 0, 0, 0.7);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-medium);
    -webkit-transition: .3s;
    transition: .3s;
	border-radius: 10px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    -webkit-transition: .3s;
    transition: .3s;
	border-radius: 7px;
}

input:checked + .slider:before {
    -webkit-transform: translateX(18px);
    -ms-transform: translateX(18px);
    transform: translateX(18px);
}

/* CSS Export Section */
.css-export-section {
    margin: 15px 0px;
    padding: 20px 0px;
    border-radius: 12px;
    text-align: center;
}

.css-export-section h2 {
    margin-bottom: 15px;
}

.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5em;
    }

    header h1 a {
        width: 100%;
    }

    .logo_imago {
        max-height: 50px;
    }

    .logo_logos {
        max-height: 45px;
    }

    .subtitle {
        font-size: 0.95em;
    }

    .tool-section {
        padding: 20px;
    }

    .color-picker-preview-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .color-controls {
        flex-direction: column;
    }

    .color-input-group {
        width: 100%;
    }
    
    .color-bar {
        min-height: 150px;
    }

    .invert-btn, .invert-btn:focus {
        margin-top: 0;
        transform: rotate(90deg);
    }

    .compliance-grid {
        grid-template-columns: 2fr 1fr 1fr;
        font-size: 0.9em;
    }

    .text-samples-grid {
        grid-template-columns: 1fr;
    }

    .about-section,
    .terms-section,
    .contact-section,
    .contact-form {
        padding: 20px;
    }

    .language-switcher {
        position: static;
        justify-content: center;
        margin-bottom: 15px;
    }

    .info-box-content {
        display: grid;
    }
}

/* Contact Page Styles */
.contact-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 15px 40px 25px 40px;;
    margin-top: 10px;
    box-shadow: var(--shadow-md);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.contact-subtitle {
    text-align: center;
    font-size: 1.1em;
    color: var(--text-medium);
    margin-bottom: 30px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    border: 2px solid var(--success-color);
    color: #155724;
}

.alert-error {
    background: #fff3cd;
    border: 2px solid var(--warning-color);
    color: #856404;
}

.contact-form {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 5px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 1em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-textarea {
    resize: vertical;
    min-height: 150px;
}

.form-note {
    font-size: 0.9em;
    color: var(--text-light);
    margin-bottom: 10px;
    font-style: italic;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-submit:active {
    transform: translateY(0);
}
