/* Shared interface styles.
   The app loads this before src/styles.css. Scenario rules stay there and override these.
   The style guide (trueforma-styles.html) links this file directly. */

/* Page title, section, subsection, and body. A screen that needs a different
   size keeps that rule in its own stylesheet. */
h1 {
    margin: 0;
    font-family: "Cormorant Infant", "Times New Roman", serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 1.2;
    color: #333;
}

h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
}

h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
}

p {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #333333;
}

.form-input {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    color: #333333;
    background-color: #ffffff;
}

.form-input::placeholder {
    color: #999;
}

.form-select {
    padding: 7px 34px 7px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23555' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 6px;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #4bbdfa;
    box-shadow: 0 0 0 3px rgba(75, 189, 250, 0.1);
}

.form-input:focus {
    border-color: #4A90E2;
}

.form-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #222;
    cursor: pointer;
}

.form-checkbox,
.form-radio {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #111;
    cursor: pointer;
    flex-shrink: 0;
}

/* Menu panel. Positioning for a specific menu stays in styles.css. */
.profile-dropdown {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Large is the default. Add .button--small for the compact size.
   .btn.button--small beats the later .btn padding in styles.css. */
.button--primary,
.button--secondary,
.button--highlight,
.button--danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 5px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.button--secondary {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #ddd;
}

.button--secondary:hover:not(:disabled):not(.button--blocked) {
    color: #333;
    border-color: #bbb;
}

.button--primary {
    background-color: #000000;
    color: #ffffff;
    border: 1px solid #000000;
}

.button--primary:hover:not(:disabled):not(.button--blocked) {
    background-color: #333333;
    border-color: #333333;
}

.button--highlight {
    background-color: #1a73e8;
    color: #ffffff;
    border: 1px solid #1a73e8;
}

.button--highlight:hover:not(:disabled):not(.button--blocked) {
    background-color: #1765cc;
    border-color: #1765cc;
}

.button--danger {
    background-color: #dc3545;
    color: #ffffff;
    border: 1px solid #dc3545;
}

.button--danger:hover:not(:disabled):not(.button--blocked) {
    background-color: #c82333;
    border-color: #c82333;
}

/* One unavailable look. :disabled cannot be clicked. .button--blocked looks
   the same and stays clickable, so a click can explain what is missing. */
.button--secondary:disabled,
.button--primary:disabled,
.button--highlight:disabled,
.button--danger:disabled,
.button--blocked {
    background-color: #666666;
    border-color: #666666;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.7;
}

.button--small,
.btn.button--small {
    padding: 8px 16px;
    font-size: 14px;
}

/* Equal-width card tabs. The active tab shares the panel's white fill. */
.tabs {
    display: flex;
    width: 100%;
}

.tab {
    flex: 1 1 0;
    margin: 0;
    padding: 16px 12px;
    border: 0;
    background: #f0f0f0;
    color: #c4c4c4;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
}

.tab--active {
    background: #ffffff;
    color: #111111;
}

.tabs .tab + .tab {
    margin-top: 0;
}

.tab:focus-visible {
    outline: 2px solid #4A90E2;
    outline-offset: -2px;
}

.tab-panel {
    background: #ffffff;
}

/* Inline notice. Distinct from the fixed .alert-message toast. */
.inline-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.4;
}

.inline-message--info {
    --inline-message-accent: #9bdcff;
    --inline-message-ink: #5393d8;
    background: #eef3f8;
    border-color: var(--inline-message-accent);
    color: var(--inline-message-ink);
}

.inline-message--warning {
    --inline-message-accent: #ffd36f;
    --inline-message-ink: #6b4a00;
    background: #fff4e5;
    border-color: var(--inline-message-accent);
    color: var(--inline-message-ink);
}

.inline-message--error {
    --inline-message-accent: #f0c2c2;
    --inline-message-ink: #7a2e2e;
    background: #fbf0f0;
    border-color: var(--inline-message-accent);
    color: var(--inline-message-ink);
}

.inline-message--success {
    --inline-message-accent: #b7dfc3;
    --inline-message-ink: #1e6b34;
    background: #e6f4ea;
    border-color: var(--inline-message-accent);
    color: var(--inline-message-ink);
}

.inline-message--neutral {
    --inline-message-accent: #e0e0e0;
    --inline-message-ink: #555;
    background: #f5f5f5;
    border-color: var(--inline-message-accent);
    color: var(--inline-message-ink);
}

.inline-message .button--small:not(:disabled):not(.button--blocked),
.inline-message .button--small:hover:not(:disabled):not(.button--blocked) {
    flex-shrink: 0;
    background-color: var(--inline-message-accent);
    border-color: var(--inline-message-accent);
    color: var(--inline-message-ink);
}

/* Fixed toast. Self-dismissing confirmation (AlertMessage). Design Studio
   save uses alert-message-success with "Design Saved". */
.alert-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 8px;
    border: 2px solid #4B5563;
    background-color: #6B7280;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    width: max-content;
    min-width: 200px;
    max-width: 400px;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    animation: alert-message-slide-down 0.3s ease-out;
}

.alert-message-success {
    background-color: #10B981;
    border-color: #059669;
}

.alert-message-warning {
    background-color: #F59E0B;
    border-color: #D97706;
}

.alert-message-danger {
    background-color: #EF4444;
    border-color: #DC2626;
}

.alert-message-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-message-text {
    flex: 1;
    text-align: left;
}

.alert-message-fading {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
}

@keyframes alert-message-slide-down {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Catalog product card. Hover overlays stay in styles.css. */
.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.card:hover {
    background-color: #f5f5f5;
}

.card.is-selected {
    border: 2px solid #1a73e8;
}

.card-select {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #c2c2c2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #fff;
}

.card.is-selected .card-select {
    border-color: #1a73e8;
    background: #1a73e8;
    color: #fff;
}

.card-media {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
}

.card-media img {
    max-width: 100%;
    max-height: 400px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.card-title {
    margin-top: 5px;
    font-family: "Cormorant Infant", "Times New Roman", serif;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    text-align: center;
}

/* Data table. A screen's status colors stay in that screen's stylesheet. */
.table-wrap {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    background: #f6f6f6;
    border-bottom: 1px solid #e8e8e8;
}

.table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-strong {
    font-weight: 600;
    color: #222;
}

.table-muted {
    color: #888;
    font-size: 12px;
}

.table-media {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-media img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 4px;
    background: #f3f3f3;
    flex-shrink: 0;
}

.table-actions {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

.table-actions .button--small + .button--small {
    margin-left: 8px;
}

/* Row card. All Projects uses these as table-like slats. */
.slat {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    padding: 10px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.slat:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Status pills. Pending matches the All Projects pending badge. */
.label {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
}

.label--draft {
    color: #6c757d;
    background-color: #e9ecef;
}

.label--in-progress {
    color: #0d6efd;
    background-color: #cfe2ff;
}

.label--pending {
    color: #997404;
    background-color: #fff3cd;
}

.label--approved {
    color: #ed12c2;
    background-color: #ffe4f2;
}

.label--ordered {
    color: #0f5132;
    background-color: #d1e7dd;
}

/* Role chips. Master Admin is the purple gradient. */
.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.role-badge.master-admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.role-badge.location-admin {
    background-color: #d4edda;
    color: #155724;
}

.role-badge.project-manager {
    background-color: #cce5ff;
    color: #004085;
}

.role-badge.sales {
    background-color: #e9ecef;
    color: #495057;
}
