/**
 * RH Trading — Account Frontend Styles
 *
 * Basic structural styles for the [rht_my_account] shortcode.
 * Designed to work with Astra theme. Customize as needed.
 *
 * Brand Colors:
 *   Primary:          #71C3B5
 *   Secondary:        #4889A1
 *   Light background: #F2F2F2
 *   Dark background:  #214F4F
 *
 * @package RHTrading
 */

/* ── Notices ─────────────────────────────── */
.rht-notice {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.rht-notice--success {
    background: #d4edda;
    border: 1px solid #71C3B5;
    color: #155724;
}

.rht-notice--error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ── Lucide Icons ────────────────────────── */
.rht-account [data-lucide] {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    display: inline-block;
    position: relative;
    top: -1px;
}

.rht-account h2 [data-lucide] {
    width: 24px;
    height: 24px;
    top: -2px;
    color: #71C3B5;
}

.rht-btn [data-lucide] {
	width: 16px;
	height: 16px;
	margin-left: 4px;
	margin-right: 0;
}

/* ── Dashboard Card Icons ────────────────── */
.rht-dashboard__card-icon {
    margin-bottom: 12px;
}

.rht-dashboard__card-icon [data-lucide] {
    width: 32px;
    height: 32px;
    color: #71C3B5;
}

/* ── Account Layout ──────────────────────── */
.rht-account {
    max-width: 100%;
    margin: 0 auto;
}

/* ── Tab Navigation ──────────────────────── */
.rht-account__nav {
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.rht-account__tabs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.rht-account__tab {
    margin: 0;
}

.rht-account__tab a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.rht-account__tab a [data-lucide] {
    width: 16px;
    height: 16px;
    top: 0;
    flex-shrink: 0;
}

.rht-account__tab a:hover {
    color: #222;
    border-bottom-color: #999;
}

.rht-account__tab--active a {
    color: #71C3B5;
    border-bottom-color: #71C3B5;
    font-weight: 600;
}

.rht-account__tab--logout a {
    color: #999;
}

.rht-account__tab--logout a:hover {
    color: #dc3545;
    border-bottom-color: #dc3545;
}
/* ── Titles ─────────────────────────── */
.rht-account__content h2 {
    margin-top: 0px !important;
}

/* ── Tab Content ─────────────────────────── */
.rht-account__content {
    padding: 10px 0;
}

/* ── Dashboard ───────────────────────────── */
.rht-dashboard h2 {
    margin-bottom: 5px;
}

.rht-dashboard__company {
    color: #666;
    font-size: 15px;
    margin-bottom: 30px;
}

.rht-dashboard__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.rht-dashboard__card {
    background: #F2F2F2;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
}

.rht-dashboard__card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
}

.rht-dashboard__card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

/* ── Forms ────────────────────────────────── */
.rht-form {
    max-width: 600px;
}

.rht-form__row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.rht-form__field {
    flex: 1;
}

.rht-form__field--full {
    flex: 0 0 100%;
}

.rht-form__field label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 14px;
    color: #333;
}

.rht-form__required {
    color: #dc3545;
}

.rht-form__field input[type="text"],
.rht-form__field input[type="email"],
.rht-form__field input[type="tel"],
.rht-form__field input[type="password"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.rht-form__field input:focus {
    border-color: #71C3B5;
    outline: none;
    box-shadow: 0 0 0 1px #71C3B5;
}

.rht-form__field input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.rht-form__help {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.rht-form__actions {
    margin-top: 24px;
}

/* ── Buttons ─────────────────────────────── */
.rht-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.rht-btn--primary {
	background: #214F4F !important;
	color: #fff;
}

.rht-btn--primary:hover {
	background: #1a3f3f !important;
	color: #fff;
}

.rht-btn--secondary {
    background: #71C3B5 !important;
    color: #fff;
}

.rht-btn--secondary:hover {
    background: #4889A1 !important;
    color: #fff;
}

a.rht-btn.rht-btn--secondary {
    color: #fff;
}

a.rht-btn.rht-btn--secondary:hover {
    color: #fff;
}

/* ── Profile Avatar ──────────────────────── */
.rht-profile__avatar {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 28px;
	padding-bottom: 24px;
	border-bottom: 1px solid #eee;
}

.rht-profile__avatar-preview {
	position: relative;
	width: 80px;
	height: 80px;
	flex-shrink: 0;
	cursor: pointer;
}

.rht-profile__avatar-preview img {
	width: 80px !important;
	height: 80px !important;
	border-radius: 50% !important;
	object-fit: cover;
	display: block;
	border: 3px solid #e0e0e0;
}

.rht-profile__avatar-change {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	cursor: pointer;
	transition: opacity 0.2s;
	color: #fff;
}

.rht-profile__avatar-preview:hover .rht-profile__avatar-change {
	opacity: 1;
}

.rht-profile__avatar-change [data-lucide] {
	width: 22px !important;
	height: 22px !important;
	top: 0 !important;
}

.rht-profile__avatar-input {
	position: absolute;
	width: 0;
	height: 0;
	opacity: 0;
	pointer-events: none;
}

.rht-profile__avatar-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.rht-profile__avatar-name {
	font-weight: 600;
	font-size: 1.05rem;
	margin: 0 0 3px;
	color: #222;
}

.rht-profile__avatar-hint {
	font-size: 0.82rem;
	color: #999;
	margin: 0;
}

.rht-profile__avatar-selected {
	font-size: 0.82rem;
	color: #71C3B5;
	font-weight: 500;
	margin: 4px 0 0;
	display: none;
}

/* ── Placeholder ─────────────────────────── */
.rht-placeholder {
    color: #999;
    font-style: italic;
    padding: 40px 0;
    text-align: center;
}

/* ── Mine køb — Tabel ────────────────────── */
.rht-mine-koeb__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rht-mine-koeb__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.rht-mine-koeb__table th {
    text-align: left;
    padding: 8px 12px;
    background: #214F4F;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.rht-mine-koeb__table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.rht-mine-koeb__table tr:hover td {
    background: #f8fffe;
}

.rht-mine-koeb__th-price,
.rht-mine-koeb__td-price {
    text-align: right;
    font-weight: 600;
    color: #214F4F;
}

.rht-mine-koeb__intro {
    font-size: 0.875rem;
    color: #666;
    margin: 0 0 12px;
}

/* ── Mine køb — Virksomhedsgrupper ──────── */
.rht-mine-koeb__group {
    margin-bottom: 28px;
}

.rht-mine-koeb__group-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #214F4F;
    margin: 0 0 10px;
    padding: 10px 14px;
    background: #d5f0eb;
    border-left: 4px solid #71C3B5;
    border-radius: 4px;
}

.rht-mine-koeb__group-heading [data-lucide] {
    color: #71C3B5;
    flex-shrink: 0;
}

.rht-mine-koeb__group-count {
    margin-left: auto;
    background: #71C3B5;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    line-height: 1;
}

/* ── Bid Status Badges ───────────────────── */
.rht-bid-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-sizing: border-box;
}

.rht-bid-status--accepted {
    background: #d5f0eb;
    color: #1e7a6a;
}

.rht-bid-status--pending {
    background: #F2F2F2;
    color: #888;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 600px) {
    .rht-account__tabs {
        flex-direction: column;
    }

    .rht-account__tab a {
        padding: 10px 16px;
        border-bottom: none;
        border-left: 2px solid transparent;
    }

    .rht-account__tab--active a {
        border-left-color: #71C3B5;
        border-bottom-color: transparent;
    }

    .rht-account__nav {
        border-bottom: none;
        border-left: 2px solid #e0e0e0;
    }

    .rht-form__row {
        flex-direction: column;
        gap: 0;
    }

    .rht-dashboard__grid {
        grid-template-columns: 1fr;
    }
}

/* ── Mine virksomheder (e-conomic tilknytninger) ────────────────────────── */
.rht-profile-eco-accounts {
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid #e5e7eb;
}

.rht-profile-eco-accounts h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #71C3B5;
    margin-bottom: 6px;
}

.rht-profile-eco-accounts h3 [data-lucide] {
    width: 18px !important;
    height: 18px !important;
    color: #214F4F;
}

.rht-profile-eco-accounts__desc {
    font-size: 0.88rem;
    color: #888;
    margin-bottom: 16px;
}

.rht-profile-eco-accounts__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (max-width: 600px) {
    .rht-profile-eco-accounts__list {
        grid-template-columns: 1fr;
    }
}

.rht-profile-eco-accounts__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #d5f0eb;
    border: 1px solid #71C3B5;
    border-radius: 8px;
    padding: 14px 16px;
}

.rht-profile-eco-accounts__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rht-profile-eco-accounts__icon [data-lucide] {
    width: 18px !important;
    height: 18px !important;
    color: #214F4F;
}

.rht-profile-eco-accounts__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.rht-profile-eco-accounts__name {
    font-size: 0.95rem;
    color: #214F4F;
    display: block;
}

.rht-profile-eco-accounts__afdeling {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: #214F4F;
}

.rht-profile-eco-accounts__afdeling [data-lucide] {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0;
}

.rht-profile-eco-accounts__cvr {
    font-size: 0.78rem;
    color: #aaa;
}

.rht-profile-eco-accounts__note {
    margin-top: 12px;
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
}
