/**
 * Design System CSS
 * Single source of truth for all design system components in Media Portal
 * This file contains buttons, typography, colors, spacing, and other design tokens
 */

/* ===========================
   BUTTONS
   =========================== */

/* PRIMARY BUTTON */
.button-primary,
.button-primary-icon,
button.button-primary,
button.button-primary-icon,
.box-body .button-primary,
.box-body .button-primary-icon,
.box-body button.button-primary,
.box-body button.button-primary-icon {
    background-color: #DD5B19 !important;
    color: #FFFFFF !important;
    padding: 10px 14px !important;
    height: 40px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 20px !important;
    font-family: Inter, sans-serif !important;
    border-radius: 12px !important;
    border: 1px solid #8A2E10 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
    text-decoration: none !important;
}

.button-primary:hover,
.button-primary-icon:hover,
button.button-primary:hover,
button.button-primary-icon:hover,
.box-body .button-primary:hover,
.box-body .button-primary-icon:hover,
.box-body button.button-primary:hover,
.box-body button.button-primary-icon:hover {
    background-color: #B74417 !important;
    color: #FFFFFF !important;
    border: 1px solid #8A2E10 !important;
}

.button-primary img,
.button-primary svg,
.button-primary-icon img,
.button-primary-icon svg {
    width: 20px;
    height: 20px;
}

/* TERTIARY BUTTON */
.button-tertiary,
button.button-tertiary,
a.button-tertiary {
    background-color: white !important;
    color: #6C757D !important;
    border: 1px solid #D5D7DA !important;
    padding: 6px 24px !important;
    height: 38px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    font-family: Inter, sans-serif !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.2s, color 0.2s !important;
}

.button-tertiary:hover,
button.button-tertiary:hover,
a.button-tertiary:hover {
    background-color: #FAFAFA !important;
    color: #6B6B6B !important;
    border: 1px solid #D5D7DA !important;
}

.button-tertiary img,
.button-tertiary svg {
    width: 20px;
    height: 20px;
}

/* FILTER BUTTON */
.button-filter {
    background-color: #FFFFFF;
    color: #414651;
    border: 1px solid #D5D7DA;
    padding: 10px 14px;
    height: 40px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    font-family: Inter, sans-serif;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.button-filter:hover {
    background-color: #FAFAFA;
    color: #252B37;
    border: 1px solid #D5D7DA;
    text-decoration: none;
}

/* ACTION BUTTON */
.button-action {
    background-color: #FEF7EE;
    color: #B74417;
    border: 1px solid #dee2e6;
    padding: 10px 14px;
    height: 40px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    font-family: Inter, sans-serif;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.button-action:hover {
    background-color: #FDEDD7;
    color: #92371A;
    border: 1px solid #dee2e6;
    text-decoration: none;
}

/* DARK BUTTON */
.button-dark,
button.button-dark,
a.button-dark {
    background-color: #231F20;
    color: #FFFFFF;
    padding: 10px 14px;
    min-width: 110px;
    height: 40px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    font-family: Inter, sans-serif;
    border-radius: 12px;
    border: 1px solid #000000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.button-dark:hover,
button.button-dark:hover,
a.button-dark:hover {
    background-color: #000000;
    color: #FFFFFF;
    border: 1px solid #000000;
    text-decoration: none;
}

.button-dark img,
.button-dark svg {
    width: 20px;
    height: 20px;
}

/* Icon class for dark button (white icons) */
.icon-dark {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* OUTLINE BUTTON (icon-only) */
.button-outline,
button.button-outline,
a.button-outline {
    background-color: #FFFFFF;
    color: #414651;
    padding: 10px;
    width: 40px;
    height: 40px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    font-family: Inter, sans-serif;
    border-radius: 12px;
    border: 1px solid #D5D7DA;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.button-outline:hover,
button.button-outline:hover,
a.button-outline:hover {
    background-color: #F8F9FA;
    color: #414651;
    border: 1px solid #D5D7DA;
    text-decoration: none;
}

.button-outline img,
.button-outline svg {
    width: 20px;
    height: 20px;
}

/* Icon class for outline button */
.icon-outline {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* NAVIGATION TOGGLE BUTTONS */
.nav-toggle-group {
    display: flex;
    background: #FEF7EE;
    border: 1px solid #FEF7EE;
    border-radius: 12px;
    padding: 4px;
    height: 40px;
    gap: 0;
    width: 100%;
}

.nav-toggle-button {
    background: #FEF7EE !important;
    color: #DD5B19 !important;
    border: 1px solid transparent !important;
    padding: 6px 14px !important;
    font-size: 14px !important;
    font-family: Inter, sans-serif !important;
    font-weight: 600 !important;
    line-height: 20px !important;
    border-radius: 12px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    text-align: center !important;
    min-width: 150px !important;
    height: 30px !important;
    flex-grow: 1 !important;
    user-select: none !important;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.nav-toggle-button:hover {
    background: #f5e5d3 !important;
    color: #DD5B19 !important;
    border: 1px solid transparent !important;
}

.nav-toggle-button.active {
    background: #DD5B19 !important;
    color: #FFFFFF !important;
    border: 1px solid #DD5B19 !important;
}

.nav-toggle-button img,
.nav-toggle-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    /* No filter needed - color #B74417 is embedded in SVG */
}

.nav-toggle-button.active img,
.nav-toggle-button.active svg {
    /* Convert #B74417 icon to white for active state */
    filter: brightness(0) invert(1);
}

/* VIEW TOGGLE BUTTONS */
.view-toggle-group {
    display: inline-flex;
    background: #FAFAFA;
    border: 1px solid #E9EAEB;
    border-radius: 12px;
    padding: 4px;
    height: 40px;
    gap: 0;
    min-width: 332px;
}

.view-toggle-button {
    background: #FAFAFA !important;
    color: #717680 !important;
    border: 1px solid transparent;
    padding: 6px 8px;
    font-size: 14px;
    font-family: Inter, sans-serif;
    font-weight: 600;
    line-height: 20px;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    min-width: 50px;
    height: 30px;
    flex-grow: 1;
    user-select: none;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.view-toggle-button:hover {
    background: #FAFAFA !important;
    color: #717680 !important;
}

.view-toggle-button.active {
    background: #FFFFFF !important;
    color: #414651 !important;
    border: 1px solid #EEEEEE !important;
    border-radius: 12px;
}

.view-toggle-button img,
.view-toggle-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    /* Tint icons to match inactive text color (#717680) */
    filter: invert(48%) sepia(6%) saturate(534%) hue-rotate(186deg) brightness(93%) contrast(88%);
}

.view-toggle-button.active img,
.view-toggle-button.active svg {
    /* Tint icons to match active text color (#414651) */
    filter: invert(27%) sepia(8%) saturate(815%) hue-rotate(186deg) brightness(95%) contrast(90%);
}

/* ===========================
   STATIC HOVER STATE HELPERS
   (For documentation pages)
   =========================== */

.button-primary.hover-static,
.button-primary-icon.hover-static {
    background-color: #B74417;
    border: 1px solid #8A2E10;
}

.button-tertiary.hover-static {
    background-color: #FAFAFA;
    color: #6B6B6B;
}

.button-filter.hover-static {
    background-color: #F8F9FA;
}

.button-action.hover-static {
    /* Action button has no visible hover change, keep same */
    background-color: #FEF7EE;
}

.button-outline.hover-static {
    background-color: #F8F9FA;
}

.nav-toggle-button.hover-static {
    background: #f5e5d3 !important;
    border: 1px solid transparent !important;
}

.view-toggle-button.hover-static {
    background: #FAFAFA !important;
    color: #717680 !important;
}

.button-dark.hover-static {
    background-color: #000000;
    border: 1px solid #000000;
}

/* ===========================
   STEP INDICATOR
   =========================== */

/* Step indicator container - centers and sizes the entire component */
.step-indicator-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

/* Step indicator inner wrapper - fixed 345px width */
.step-indicator-wrapper {
    width: 345px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Connecting line between steps */
.step-indicator-line {
    flex: 1;
    height: 2px;
    margin: 0 8px;
}

/* Line color - gray for incomplete, green for completed */
.step-indicator-line.incomplete {
    background-color: #D5D7DA;
}

.step-indicator-line.completed {
    background-color: #28A745;
}

/* Individual step circle */
.step-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #FFFFFF;
    border: 2px solid #D5D7DA;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-family: Inter, sans-serif;
    font-weight: 600;
    line-height: 18px;
    color: #717680;
    word-wrap: break-word;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    position: relative;
}

.step-indicator.active {
    background-color: #FFFFFF;
    border-color: #DD5B19;
    color: #414651;
    font-size: 12px;
    font-family: Inter, sans-serif;
    font-weight: 600;
    line-height: 18px;
    word-wrap: break-word;
}

.step-indicator.completed {
    background-color: #28A745;
    border-color: #28A745;
    color: #FFFFFF;
    font-size: 0;
}

.step-indicator.completed::before {
    content: "✓";
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
}

/* ===========================
   TYPOGRAPHY
   =========================== */

/* BRAND TITLE - 24px, no margin, for page identity/brand names */
.typo-brand-title {
    box-sizing: border-box;
    color: #212529;
    display: block;
    font-family: Inter, sans-serif;
    font-size: 24px;
    font-weight: 600;
    height: 36px;
    line-height: 36px;
    margin: 0;
    padding: 0;
    text-align: start;
    width: auto;
}

/* SECTION HEADING - 24px, 25px bottom margin, for major sections */
.typo-section-heading {
    box-sizing: border-box;
    color: #212529;
    display: block;
    font-family: Inter, sans-serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 30px;
    margin: 0 0 25px 0;
    padding: 0;
    text-align: start;
    width: auto;
}

/* CONTENT HEADING - 20px, 25px bottom margin, for subsections */
.typo-content-heading {
    box-sizing: border-box;
    color: #212529;
    display: block;
    font-family: Inter, sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 30px;
    margin: 0 0 25px 0;
    padding: 0;
    text-align: start;
    width: auto;
}

/* ===========================
   DESIGN SYSTEM DOCUMENTATION LAYOUT
   (For /admin/app/designsystem pages)
   =========================== */

.ds-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
}

.ds-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.ds-header h1 {
    font-size: 32px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 10px 0;
    font-family: Inter, sans-serif;
}

.ds-header p {
    font-size: 16px;
    color: #6C757D;
    margin: 0;
}

.box-body .ds-component {
    margin-bottom: 50px;
    padding: 30px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.ds-component-title {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 20px 0;
    font-family: Inter, sans-serif;
}

.ds-component-description {
    font-size: 14px;
    color: #6C757D;
    margin: 0 0 30px 0;
}

.box-body .ds-variants-container {
    display: flex !important;
    gap: 40px;
}

.ds-variants {
    flex: 2;
}

.ds-properties {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    height: fit-content;
}

.ds-variant {
    margin-bottom: 30px;
}

.ds-variant-title {
    font-size: 14px;
    font-weight: 600;
    color: #656565;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.box-body .ds-states {
    display: flex !important;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 10px;
}

.box-body .ds-state {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ds-state-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ds-code {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #333;
    overflow-x: auto;
}

.ds-properties-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 15px 0;
}

.ds-property-group {
    margin-bottom: 15px;
}

.ds-property-group strong {
    font-size: 12px;
    font-weight: 600;
    color: #656565;
    display: block;
    margin-bottom: 5px;
}

.ds-property-value {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #333;
    line-height: 1.6;
    padding-left: 10px;
}

.ds-gradient-bg {
    background: linear-gradient(to right, #FFECD2, #FCB69F);
    padding: 20px;
    border-radius: 8px;
}

.ds-nav-toggle-demo {
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 10px;
}

/* ===========================
   LOADING SPINNERS
   =========================== */

/* Bootstrap-style spinner animation */
@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

.spinner-border-lg {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
}

/* Spinner brand color */
.spinner-brand {
    color: #DD5B19;
}

/* Visually hidden (for accessibility) */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Modal overlay with spinner */
.spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 1000;
}

/* Demo modal content container */
.spinner-demo-modal {
    position: relative;
    width: 100%;
    height: 200px;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.spinner-demo-modal-content {
    padding: 20px;
}

.spinner-demo-modal-title {
    margin: 0 0 10px 0;
    color: #231F20;
}

.spinner-demo-modal-text {
    margin: 0;
    color: #6C757D;
    font-size: 14px;
}

/* HTMX code example box */
.htmx-code-example {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
}

.htmx-code-example p {
    margin: 0 0 10px 0;
    font-size: 13px;
}

.htmx-code-example p:last-child {
    margin: 10px 0 0 0;
}

.htmx-code-example code {
    font-size: 11px;
    display: block;
    white-space: pre-wrap;
}

/* ===========================
   FORM VALIDATION TOOLTIPS
   =========================== */

/* Custom validation tooltip - replaces browser default */
/* Uses warning toast notification styling */
.validation-tooltip {
    position: absolute;
    z-index: 10000;
    box-sizing: border-box;
    display: none;
    align-items: center;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: Inter, sans-serif;
    font-size: 14px;
    line-height: 20px;
    min-width: 250px;
    max-width: 350px;
    /* Dark background with white text like toast notifications */
    background-color: #2d3748;
    color: #ffffff;
    border: none;
    pointer-events: auto;
}

.validation-tooltip.show {
    display: flex;
}

.validation-tooltip-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    position: relative;
    top: 4px;
    /* Warning color from toast notifications */
    color: #FFC107;
}

.validation-tooltip-content {
    box-sizing: border-box;
    color: #ffffff;
    cursor: default;
    display: inline-block;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    margin: 0;
    margin-left: 8px;
    padding: 0;
    text-align: start;
    pointer-events: auto;
    word-wrap: break-word;
    flex: 1;
}

/* Tooltip arrow pointing to the input field */
.validation-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #2d3748;
}

/* Form field states */
.form-field-invalid {
    border-color: #DD5B19 !important;
    outline: none;
}

.form-field-invalid:focus {
    border-color: #DD5B19 !important;
    box-shadow: 0 0 0 3px rgba(221, 91, 25, 0.1) !important;
}

/* Error icon for form fields (optional) */
.form-field-error-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.form-field-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* ===========================
   INLINE ALERT NOTIFICATIONS
   =========================== */

/* Base inline alert notification - matches toast notification design system */
.alert-notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: Inter, sans-serif;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    margin-bottom: 12px;
    /* Dark background with white text */
    background-color: #2d3748;
    color: #ffffff;
    border: none;
}

/* Alert icon */
.alert-notification-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 0px;
}

/* Alert content */
.alert-notification-content {
    flex: 1;
    color: #ffffff;
    font-weight: 400;
}

/* Alert close button */
.alert-notification-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #ffffff;
    opacity: 0.7;
    padding: 4px;
    margin-left: 8px;
    border-radius: 4px;
}

.alert-notification-close:hover {
    opacity: 1;
}

.alert-notification-close:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
    opacity: 1;
}

.alert-notification:focus-within {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Success variant - green icon */
.alert-notification-success .alert-notification-icon {
    color: #079455;
}

/* Error variant - red icon */
.alert-notification-error .alert-notification-icon {
    color: #DC3545;
}

/* Warning variant - yellow icon */
.alert-notification-warning .alert-notification-icon {
    color: #FFC107;
}

/* Info variant - blue icon */
.alert-notification-info .alert-notification-icon {
    color: #2196F3;
}

/* ===========================
   TAG BADGES
   =========================== */

/* Tag listing container - allows tags to wrap */
.tag-listing {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

/* Individual tag badge */
.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background-color: #FFFFFF;
    color: #495057;
    font-family: Inter, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    word-break: break-word;
    max-width: 100%;
    transition: background-color 0.2s, border-color 0.2s;
}

/* Hover state for interactive tags */
.tag-badge:hover {
    background-color: #F8F9FA;
    border-color: #D5D7DA;
}

/* ===========================
   LOGIN LINK SENT STATE
   =========================== */

.login-link-sent {
    max-width: 400px;
    margin: 0 auto;
}


.login-link-sent-heading {
    font-weight: 700;
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 16px;
    color: #111;
}

.login-link-sent-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #f0fdf4;
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 16px;
    text-align: left;
    font-size: 16px;
    color: #333;
    line-height: 22px;
}

.login-link-sent-banner-icon {
    flex-shrink: 0;
}

.login-link-sent-banner strong {
    color: #111;
}

.login-link-sent-hint {
    font-size: 13px;
    color: #656565;
    line-height: 20px;
}

.login-link-resend-btn {
    margin-top: 24px;
    font-size: 16px !important;
}

.login-link-resend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-link-change-email {
    font-size: 13px;
    color: #656565;
    text-decoration: none;
}

.login-link-change-email:hover {
    color: #111;
    text-decoration: underline;
}

