/**
 * House Management & Upgrade System Styling
 * Floor plan viewer with interactive rooms and furniture
 */

/* Main house management overlay */
.house-management-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(58, 50, 56, 0);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 4000;
    transition: background 0.5s ease;
    padding: 2rem;
}

.house-management-overlay.active {
    background: rgba(58, 50, 56, 0.9);
}

/* Floor plan popup */
.floor-plan-popup {
    background: #EBE6D8;
    padding: 2rem;
    width: 90vw;
    max-width: 1200px;
    max-height: 90vh;
    position: relative;
    border: 2px solid #8E7F7F;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.floor-plan-popup.active {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.floor-plan-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(212,200,190,0.4) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(212,200,190,0.4) 0%, transparent 35%);
    pointer-events: none;
}

/* Document decorations */
.house-folder-tab {
    position: absolute;
    width: 200px;
    height: 35px;
    background: #D4C8BE;
    top: -35px;
    left: 30px;
    border: 2px solid #8E7F7F;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #3A3238;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.house-classification-stamp {
    position: absolute;
    top: 20px;
    right: 30px;
    transform: rotate(15deg);
    color: #8E7F7F;
    border: 3px solid #8E7F7F;
    padding: 8px 16px;
    font-weight: bold;
    font-size: 13px;
    opacity: 0.8;
    letter-spacing: 1px;
}

.house-paperclip {
    position: absolute;
    top: -20px;
    right: 80px;
    width: 30px;
    height: 60px;
    border: 3px solid #8E7F7F;
    border-radius: 5px 5px 0 0;
    transform: rotate(5deg);
    opacity: 0.6;
}

/* Header */
.house-popup-header {
    border-bottom: 2px solid #8E7F7F;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
    color: #3A3238;
    font-size: 14px;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Floor plan container */
.floor-plan {
    width: 100%;
    height: calc(90vh - 250px);
    min-height: 400px;
    background: rgba(212,200,190,0.3);
    border: 2px solid #8E7F7F;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

.floor-plan svg {
    width: 100%;
    height: 100%;
}

/* Interactive elements */
.room, .furniture {
    cursor: pointer;
    transition: fill 0.3s;
}

.room:hover, .furniture:hover {
    fill: rgba(142,127,127,0.3) !important;
}

.selected-highlight {
    stroke: #8E7F7F;
    stroke-width: 2;
    stroke-dasharray: 4 2;
    fill: none !important;
}

/* Info popup */
.house-info-popup {
    position: absolute;
    background: #EBE6D8;
    padding: 1.5rem;
    border: 2px solid #8E7F7F;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    width: 300px;
    max-width: calc(100vw - 4rem);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: top left;
}

.house-info-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(212,200,190,0.4) 0%, transparent 50%);
    pointer-events: none;
}

.house-info-popup.active {
    opacity: 1;
    transform: scale(1);
}

.house-info-title {
    font-weight: bold;
    color: #3A3238;
    font-size: 14px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #8E7F7F;
    position: relative;
    z-index: 1;
}

.house-info-content {
    line-height: 1.6;
    position: relative;
    z-index: 1;
    font-size: 12px;
}

.house-info-content p {
    margin-bottom: 0.75rem;
}

.house-info-content strong {
    text-transform: uppercase;
    font-size: 10px;
    color: #5F5449;
    letter-spacing: 0.5px;
}

.house-info-content ul {
    margin: 5px 0 15px 20px;
    list-style: disc;
}

.house-info-content li {
    margin-bottom: 0.25rem;
    color: #5F5449;
}

.house-redacted {
    background: #3A3238;
    color: transparent;
    padding: 0 4px;
    border-radius: 2px;
    user-select: none;
}

/* Furniture catalog popup */
.furniture-catalog-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #EBE6D8;
    padding: 2rem;
    border: 2px solid #8E7F7F;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: none;
    z-index: 5000;
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.catalog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(58, 50, 56, 0.9);
    display: none;
    z-index: 4500;
}

.furniture-catalog-header {
    border-bottom: 2px solid #8E7F7F;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
    color: #3A3238;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.furniture-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.furniture-item {
    background: rgba(212,200,190,0.3);
    border: 2px solid #8E7F7F;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.furniture-item:hover {
    background: rgba(142,127,127,0.2);
    border-color: #5F5449;
}

.furniture-security-level {
    position: absolute;
    top: 8px;
    right: 8px;
    background: darkred;
    color: #EBE6D8;
    padding: 2px 6px;
    font-size: 9px;
    border-radius: 2px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.furniture-image {
    width: 100%;
    height: 150px;
    background: #D4C8BE;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #8E7F7F;
    padding: 1rem;
    text-align: center;
    font-size: 11px;
    line-height: 1.5;
    color: #5F5449;
}

.furniture-name {
    font-weight: bold;
    color: #3A3238;
    margin-bottom: 0.25rem;
    font-size: 12px;
}

.furniture-period {
    font-size: 11px;
    color: #5F5449;
    font-style: italic;
}

.furniture-cost {
    font-size: 13px;
    color: #3A3238;
    font-weight: bold;
    margin-top: 0.5rem;
}

/* Buttons */
.house-button {
    background: #D4C8BE;
    border: 2px solid #8E7F7F;
    padding: 8px 16px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.house-button:hover {
    background: #8E7F7F;
    color: #EBE6D8;
}

.house-modify-button {
    width: 100%;
    margin-top: 0.5rem;
    padding: 8px;
}

.house-install-button {
    width: 100%;
    margin-top: 0.5rem;
}

.house-close-button {
    background: #8E7F7F;
    color: #EBE6D8;
}

.house-close-button:hover {
    background: #5F5449;
}

/* Footer */
.house-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 2px solid #8E7F7F;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

.house-reference-number {
    font-family: monospace;
    font-size: 10px;
    color: #5F5449;
}

/* Scrollbar */
.floor-plan-popup::-webkit-scrollbar,
.furniture-catalog-popup::-webkit-scrollbar,
.house-info-popup::-webkit-scrollbar {
    width: 8px;
}

.floor-plan-popup::-webkit-scrollbar-track,
.furniture-catalog-popup::-webkit-scrollbar-track,
.house-info-popup::-webkit-scrollbar-track {
    background: rgba(142, 127, 127, 0.1);
}

.floor-plan-popup::-webkit-scrollbar-thumb,
.furniture-catalog-popup::-webkit-scrollbar-thumb,
.house-info-popup::-webkit-scrollbar-thumb {
    background: #8E7F7F;
    border-radius: 4px;
}

.floor-plan-popup::-webkit-scrollbar-thumb:hover,
.furniture-catalog-popup::-webkit-scrollbar-thumb:hover,
.house-info-popup::-webkit-scrollbar-thumb:hover {
    background: #5F5449;
}

/* Tabs */
.house-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #8E7F7F;
    padding-bottom: 0;
}

.house-tab {
    background: #D4C8BE;
    color: #3A3238;
    border: 2px solid #8E7F7F;
    border-bottom: none;
    padding: 0.75rem 2rem;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    bottom: -2px;
}

.house-tab:hover {
    background: #C4B8AE;
}

.house-tab.active {
    background: #EBE6D8;
    color: #3A3238;
    border-bottom: 2px solid #EBE6D8;
}

/* View Content */
.house-view-content {
    min-height: 400px;
}

/* Furniture Registry */
.furniture-registry {
    background: rgba(212, 200, 190, 0.3);
    padding: 1.5rem;
    border: 2px solid #8E7F7F;
}

.registry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #8E7F7F;
}

.registry-title {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #3A3238;
    letter-spacing: 1px;
}

.registry-count {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    color: #5F5449;
    background: #D4C8BE;
    padding: 0.5rem 1rem;
    border: 1px solid #8E7F7F;
}

/* Registry List */
.registry-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.registry-item {
    background: #EBE6D8;
    border: 2px solid #8E7F7F;
    padding: 1rem;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 1rem;
    align-items: center;
    transition: all 0.2s;
}

.registry-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateX(2px);
}

.registry-item-number {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    color: #8E7F7F;
    min-width: 50px;
}

.registry-item-icon {
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #D4C8BE;
    border: 1px solid #8E7F7F;
}

.registry-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.registry-item-name {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    color: #3A3238;
}

.registry-item-meta {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #5F5449;
}

.registry-meta-label {
    font-weight: bold;
}

.registry-meta-separator {
    margin: 0 0.5rem;
    color: #8E7F7F;
}

.registry-item-description {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #5F5449;
    font-style: italic;
}

.registry-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.registry-item-value {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    color: #3A3238;
}

.house-remove-button {
    background: #8E7F7F;
    color: #EBE6D8;
    border: 2px solid #8E7F7F;
    padding: 0.5rem 1rem;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.house-remove-button:hover {
    background: #5F5449;
    border-color: #5F5449;
}

/* Registry Empty State */
.registry-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    min-height: 400px;
}

.registry-empty-icon {
    font-size: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.registry-empty-title {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #5F5449;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.registry-empty-text {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #8E7F7F;
    line-height: 1.6;
}

/* Furniture Storage */
.furniture-storage {
    background: rgba(212, 200, 190, 0.3);
    padding: 1.5rem;
    border: 2px solid #8E7F7F;
    position: relative;
}

.storage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #8E7F7F;
}

.storage-title {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #3A3238;
    letter-spacing: 1px;
}

.storage-count {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    color: #5F5449;
    background: #D4C8BE;
    padding: 0.5rem 1rem;
    border: 1px solid #8E7F7F;
}

.storage-floor-plan {
    width: 100%;
    height: auto;
    background: #EBE6D8;
    border: 2px solid #8E7F7F;
}

.storage-empty {
    display: block;
    width: 100%;
}

.furniture-storage {
    width: 100%;
}

.storage-item {
    transition: all 0.2s;
}

.storage-item:hover .storage-item-box {
    fill: #C4B8AE;
    stroke-width: 3;
}

/* Storage Info Panel */
.storage-info-panel {
    position: absolute;
    top: 80px;
    right: 30px;
    width: 300px;
    background: #EBE6D8;
    border: 3px solid #5F5449;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
}

.storage-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #8E7F7F;
}

.storage-detail-icon {
    font-size: 48px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #D4C8BE;
    border: 2px solid #8E7F7F;
}

.storage-detail-title {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    color: #3A3238;
    flex: 1;
}

.storage-detail-info {
    margin-bottom: 1rem;
}

.storage-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(142, 127, 127, 0.3);
}

.storage-label {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    color: #5F5449;
}

.storage-value {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #3A3238;
}

.storage-detail-description {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #5F5449;
    font-style: italic;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(212, 200, 190, 0.3);
    border: 1px solid #8E7F7F;
}

.storage-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Storage room hover effect */
.storage-room {
    cursor: pointer;
    transition: all 0.3s;
}

.storage-room:hover {
    fill: rgba(212,200,190,0.3);
    stroke: #5F5449;
    stroke-width: 3;
}

/* Floor plan scrollbar */
.floor-plan::-webkit-scrollbar {
    width: 8px;
}

.floor-plan::-webkit-scrollbar-track {
    background: rgba(142, 127, 127, 0.1);
}

.floor-plan::-webkit-scrollbar-thumb {
    background: #8E7F7F;
    border-radius: 4px;
}

.floor-plan::-webkit-scrollbar-thumb:hover {
    background: #5F5449;
}
