/* -------------------------------------------------------------------
   Global Reset & Base Styles
   ------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", "Arial", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s, opacity 0.2s;
}
a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* -------------------------------------------------------------------
   Main Layout Structure
   ------------------------------------------------------------------- */
.container {
    max-width: 98%; 
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

.site-header {
    background-color: #2c3e50;
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.site-header h1 {
    margin: 0;
    font-size: 1.2rem;
}
.site-header h1 a {
    color: white;
    text-decoration: none;
}

.main-wrapper {
    display: flex;
    gap: 30px;
    padding: 20px;
    align-items: flex-start;
}

/* Sidebar (Fixed Width) */
.sidebar {
    flex: 0 0 300px;
    width: 300px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e1e4e8;
}
.sidebar .nav-section {
    margin-bottom: 25px;
}
.sidebar h2, .sidebar h3 {
    font-size: 0.95rem;
    color: #555;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 10px;
    margin-top: 0;
}
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar li {
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.sidebar input, .sidebar select {
    max-width: 100%;
}

/* Main Content Area */
.main-content {
    flex: 1; 
    min-width: 0;
    width: 0;
    background-color: transparent;
}

/* -------------------------------------------------------------------
   Dashboard Layout (detail.php) - PRO FIXED LAYOUT
   ------------------------------------------------------------------- */
.detail-container {
    width: 100%;
}

.viewing-dashboard {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Header Area in Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}
.title-group h1 {
    font-size: 1.5rem;
    margin: 0;
    line-height: 1.3;
    color: #1a202c;
}

/* ★ 注目物件トグルボタン */
.btn-star-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.8rem;
    color: #cbd5e0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-star-toggle:hover {
    color: #f6e05e;
    transform: scale(1.1);
}
.btn-star-toggle.active {
    color: #ecc94b;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.btn-star-toggle:active {
    transform: scale(0.95);
}

.badge-court {
    display: inline-block;
    background: #4a5568;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    vertical-align: middle;
}
.badge-featured {
    display: inline-block;
    background: #ecc94b;
    color: #744210;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    vertical-align: middle;
}

.price-summary {
    text-align: right;
    white-space: nowrap;
}
.price-item {
    font-size: 0.85rem;
    color: #718096;
}
.price-item.highlight {
    font-size: 1rem;
    color: #2d3748;
    margin-top: 2px;
}
.price-item.highlight .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e53e3e;
    font-family: "Helvetica Neue", sans-serif;
}
.price-item.highlight .unit {
    font-size: 0.9rem;
    font-weight: normal;
}

/* --- Dashboard Grid System --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

/* Left Column (Visuals) */
.col-visual {
    width: 100%;
}

.main-visual-frame {
    width: 100%;
    height: 450px;
    background: #edf2f7;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    position: relative; /* 拡大ヒント用 */
}
.main-visual-frame img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.no-image-placeholder {
    color: #a0aec0;
    font-weight: bold;
    font-size: 1.2rem;
}
.zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.8;
}

.thumbnail-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 20px;
    scrollbar-width: thin;
}
.thumb-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s;
    flex-shrink: 0;
    background: #fff;
}
.thumb-img:hover {
    border-color: #3182ce;
}

.map-frame {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.map-caption {
    background: #f7fafc;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #4a5568;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Right Column (Info) */
.col-info {
    width: 100%;
}

.info-card {
    background: #fff;
    margin-bottom: 25px;
}
.info-card h3 {
    font-size: 1rem;
    border-left: 4px solid #3182ce;
    padding-left: 12px;
    margin: 0 0 15px;
    color: #2d3748;
    font-weight: 700;
}

/* Tables in Detail */
.simple-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}
.simple-table th, .simple-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: top;
    word-break: break-all;
}
.simple-table th {
    width: 100px;
    color: #718096;
    font-weight: normal;
    background-color: #f7fafc;
}
.simple-table td {
    color: #2d3748;
}
.simple-table .result-row {
    background: #fff5f5;
}
.simple-table .result-row .price {
    color: #e53e3e;
    font-weight: bold;
    font-size: 1.1rem;
    display: block;
}

/* マンション表示用 */
.condo-cell {
    position: relative;
}
.condo-link {
    font-weight: bold;
    color: #2c5282;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.condo-link:hover { text-decoration: underline; }
.condo-memo-preview {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-top: 3px;
}
.btn-sm { padding: 4px 8px; font-size: 0.8rem; border-radius: 3px; cursor: pointer; }
.btn-outline { border: 1px solid #cbd5e0; background: #fff; color: #4a5568; }
.btn-outline:hover { background: #f7fafc; }

.scrollable-details {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    background: #f7fafc;
}
.detail-block {
    margin-bottom: 15px;
    border-bottom: 1px dashed #cbd5e0;
    padding-bottom: 10px;
}
.detail-block strong {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #2b6cb0;
}
.detail-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}
.detail-block li {
    display: flex;
    margin-bottom: 4px;
}
.detail-block .k {
    width: 100px;
    color: #718096;
    flex-shrink: 0;
}
.detail-block .v {
    flex: 1;
    color: #2d3748;
}

.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid #e53e3e;
    color: #e53e3e;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    margin-right: 8px;
    margin-bottom: 8px;
    font-weight: bold;
}
.btn-pdf:hover {
    background: #fff5f5;
    text-decoration: none;
}

.memo-card .memo-content {
    background: #fffff0;
    border: 1px solid #f6e05e;
    padding: 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.6;
}

/* Actions Footer */
.view-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-back {
    color: #718096;
    font-size: 0.9rem;
}
.btn-scroll-edit {
    color: #3182ce;
    font-weight: bold;
    font-size: 0.9rem;
}

/* -------------------------------------------------------------------
   Admin Panel
   ------------------------------------------------------------------- */
.admin-panel {
    background: #2d3748; 
    border-radius: 8px;
    color: #edf2f7;
    overflow: hidden;
    margin-bottom: 50px;
    width: 100%;
}
.admin-summary {
    background: #1a202c;
    padding: 15px 25px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.admin-summary::-webkit-details-marker { display: none; }
.admin-summary:hover { background: #2d3748; }

.admin-content {
    padding: 25px;
    background: #fff;
    color: #333;
    border-top: 1px solid #4a5568;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.admin-section {
    background: #f7fafc;
    border: 1px solid #edf2f7;
    border-radius: 6px;
    padding: 20px;
}
.admin-section h4 {
    margin: 0 0 15px;
    font-size: 0.95rem;
    color: #2d3748;
    border-bottom: 2px solid #cbd5e0;
    padding-bottom: 5px;
}

.dropzone {
    min-height: 100px;
    border: 2px dashed #cbd5e0;
    background: #fff;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}
.mini-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding: 5px;
    background: #fff;
    border: 1px solid #edf2f7;
}
.mini-file-item {
    position: relative;
    width: 60px;
    height: 60px;
    border: 1px solid #cbd5e0;
    flex-shrink: 0;
}
.mini-file-item.main { border: 2px solid #e53e3e; }
.mini-file-item img { width: 100%; height: 100%; object-fit: cover; }
.mini-file-item .actions {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.7);
    display: flex; justify-content: space-between;
    opacity: 0; transition: opacity 0.2s;
}
.mini-file-item:hover .actions { opacity: 1; }
.mini-file-item button {
    background: none; border: none; color: white;
    font-size: 10px; cursor: pointer; padding: 2px 5px;
}

.flex-form { display: flex; gap: 8px; }
.flex-form.column-dir { flex-direction: column; }
.flex-form input[type="text"],
.flex-form textarea,
.full-width {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9rem;
    width: 100%;
}
.flex-form button, .btn-submit {
    background: #3182ce; color: white; border: none;
    padding: 8px 16px; border-radius: 4px; cursor: pointer;
    font-size: 0.9rem; white-space: nowrap;
}
.btn-danger-block {
    width: 100%; background: #e53e3e; color: white;
    border: none; padding: 10px; border-radius: 4px; cursor: pointer;
}
.action-buttons { display: flex; flex-direction: column; gap: 12px; }
.btn-tool {
    background: #718096; color: white; text-align: center;
    padding: 10px; border-radius: 4px; font-size: 0.9rem;
}

/* -------------------------------------------------------------------
   Index & List Pages
   ------------------------------------------------------------------- */
.submission-section, .notification-section, .property-list-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
    margin-bottom: 25px;
}

.property-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.property-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 20px;
    transition: transform 0.1s, box-shadow 0.1s;
}
.property-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.thumbnail {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid #edf2f7;
}
.thumbnail.no-image {
    background: #f7fafc;
    color: #cbd5e0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
}
.property-info { flex: 1; min-width: 0; }
.info-header {
    display: flex; justify-content: space-between; flex-wrap: wrap;
    gap: 10px; margin-bottom: 10px; border-bottom: 1px solid #edf2f7; padding-bottom: 5px;
}
.case-number { font-weight: bold; color: #2d3748; font-size: 1.05rem; }
.open-date { font-size: 0.85rem; color: #718096; }
.info-body { font-size: 0.9rem; }
.info-body p { margin: 4px 0; color: #4a5568; }
.item-actions {
    width: 140px; flex-shrink: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.item-actions a, .item-actions button {
    display: block; width: 100%; padding: 8px; text-align: center;
    border-radius: 4px; font-size: 0.85rem; cursor: pointer;
}
.details-link { background: #3182ce; color: white; }
.source-link { background: #718096; color: white; }
.delete-link { background: transparent; border: 1px solid #e53e3e; color: #e53e3e; }
.delete-link:hover { background: #e53e3e; color: white; }

.notification-columns { display: flex; gap: 20px; }
.notification-column { flex: 1; min-width: 0; }
.notification-column h3 {
    font-size: 0.95rem; border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px; margin-bottom: 10px; color: #4a5568;
}
.notification-column ul {
    border: 1px solid #edf2f7; border-radius: 4px; padding: 10px;
    background: #fcfcfc; max-height: 250px; overflow-y: auto;
}
.notification-column li {
    margin-bottom: 8px; font-size: 0.85rem;
    border-bottom: 1px dashed #edf2f7; padding-bottom: 4px;
}
/* アイコンを少し小さくしないとfontawesomeの有無で行間がずれる */
.notification-column i{font-size:0.75em; font-weight:bold; color:red;}

/* リンクタグ自体をFlexコンテナにして、中身を整列させる */
.notification-column li a {
    display: flex;
    align-items: center; /* 縦方向の中央揃え */
    gap: 5px;            /* アイコンと文字の間隔（お好みで調整） */
    line-height: 0.8;    /* 行の高さを明示的に指定して統一 */
    text-decoration: none; /* 必要に応じて（下線を消す場合） */
    color: inherit;      /* 文字色を親に合わせる */
}

.notification-column li:last-child { border-bottom: none; }

.search-form { display: grid; gap: 15px; }
.search-form .form-group { margin: 0; }
.search-form label { font-size: 0.85rem; color: #4a5568; font-weight: bold; }
.search-form input, .search-form select {
    width: 100%; padding: 8px; border: 1px solid #cbd5e0; border-radius: 4px;
}
.date-range, .price-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 5px; align-items: center; }
.pagination { text-align: center; margin-top: 30px; }
.pagination a, .pagination span {
    display: inline-block; padding: 8px 12px; margin: 0 2px;
    border: 1px solid #e2e8f0; border-radius: 4px;
    background: #fff; color: #3182ce; font-size: 0.9rem;
}
.pagination a.active { background: #3182ce; color: white; border-color: #3182ce; }
.pagination a:hover:not(.active) { background: #edf2f7; }

/* -------------------------------------------------------------------
   Modals & Lightbox
   ------------------------------------------------------------------- */
.modal-wrapper, .lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2000;
}
.modal-overlay, .lightbox-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
}
.lightbox-overlay { background: rgba(0,0,0,0.9); }

.modal-content {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff; padding: 25px; border-radius: 8px;
    display: flex; flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.small-modal { width: 90%; max-width: 400px; }
.medium-modal { width: 90%; max-width: 600px; }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 10px;
}
.modal-header h3 { margin: 0; font-size: 1.2rem; color: #2d3748; }
.modal-close-icon {
    background: none; border: none; font-size: 1.5rem;
    cursor: pointer; color: #a0aec0;
}
.modal-body-form .form-group { margin-bottom: 15px; }
.modal-footer { margin-top: 20px; text-align: right; }

.btn-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.btn-cancel {
    background: #edf2f7; color: #4a5568; border: none;
    padding: 8px 16px; border-radius: 4px; cursor: pointer;
}
.btn-danger-outline {
    background: transparent; border: 1px solid #e53e3e; color: #e53e3e;
    padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.85rem;
}

/* Lightbox Content */
.lightbox-content {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%; height: 90%;
    display: flex; align-items: center; justify-content: center;
}
#lightboxImg {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.lb-prev, .lb-next, .lb-close {
    position: absolute; background: none; border: none;
    color: white; font-size: 3rem; cursor: pointer;
    text-shadow: 0 0 5px black; opacity: 0.7; transition: opacity 0.2s;
}
.lb-prev:hover, .lb-next:hover, .lb-close:hover { opacity: 1; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 20px; right: 20px; font-size: 2rem; }
.lb-counter {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    color: white; font-size: 1rem; text-shadow: 0 0 3px black;
}