/**
 * platfmgmt Module Stylesheet
 * Version: 0.25.09.19 (UI Overhaul)
 * Date: 2025-09-19
 */

/* === Base & Reset === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #343a40;
    background-color: #f8f9fa;
}

/* === Layout === */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
}

/* === Header === */
.header {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.header h1 {
    color: #007bff;
    font-size: 22px;
    font-weight: 600;
}
.header .nav {
    margin-top: 0;
}
.header .nav a {
    display: inline-block;
    padding: 8px 15px;
    margin-left: 8px;
    color: #495057;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}
.header .nav a:hover {
    background-color: #e9ecef;
    color: #0056b3;
}
.header .nav a.active {
    background-color: #007bff;
    color: white;
}

/* === Card === */
.card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 25px;
    overflow: hidden;
}
.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 25px;
    font-weight: 600;
    font-size: 16px;
    color: #495057;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-body {
    padding: 25px;
}

/* === Table === */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}
.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}
.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}
.table tbody tr:hover {
    background: #f1f3f5;
}

/* === Forms === */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
}
.form-control,
.frm_input {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus,
.frm_input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}
.form-control.required,
.frm_input.required {
    border-left: 3px solid #dc3545;
}
.form-textarea {
    height: auto;
    resize: vertical;
    min-height: 120px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.form-info {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

/* Search Form */
.search-form {
    background: white;
    padding: 20px 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}
.search-form .form-group {
    margin-bottom: 0;
    flex-grow: 1;
}
.search-form .form-group.search-input-group {
    flex-grow: 2;
}

/* === Buttons (v3 - Prefixed & Isolated) === */
.pm-btn {
    /* Reset & Structure */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    padding: 0 16px;
    height: 38px;
    border: 1px solid transparent;
    border-radius: 5px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Text & Font */
    font-family: inherit;
    font-size: 14px !important;
    font-weight: 500;
    line-height: 1.5;
    color: #fff;
    text-align: center;
    text-decoration: none !important;
    white-space: nowrap;

    /* Behavior */
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.pm-btn:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Color Schemes */
.pm-btn-primary {
    background-color: #007bff; color: #fff; border-color: #007bff;
}
.pm-btn-primary:hover {
    background-color: #0069d9; border-color: #0062cc;
}

.pm-btn-secondary {
    background-color: #6c757d; color: #fff; border-color: #6c757d;
}
.pm-btn-secondary:hover {
    background-color: #5a6268; border-color: #545b62;
}

.pm-btn-danger {
    background-color: #dc3545; color: #fff; border-color: #dc3545;
}
.pm-btn-danger:hover {
    background-color: #c82333; border-color: #bd2130;
}

.pm-btn-success {
    background-color: #28a745; color: #fff; border-color: #28a745;
}
.pm-btn-success:hover {
    background-color: #218838; border-color: #1e7e34;
}

.pm-btn-default {
    background-color: #f8f9fa; color: #343a40; border-color: #ced4da;
}
.pm-btn-default:hover {
    background-color: #e2e6ea; border-color: #bdaead;
}

.pm-btn-info {
    background-color: #17a2b8; color: #fff; border-color: #17a2b8;
}
.pm-btn-info:hover {
    background-color: #138496; border-color: #117a8b;
}


/* === PLATFMGMT Pagination === */
.platfmgmt-pagination {
    text-align: center !important;
    margin: 40px auto 50px auto !important;
    clear: both !important;
    width: 100% !important;
    display: block !important;
    padding: 20px 0 !important;
    box-sizing: border-box !important;
}

.platfmgmt-pagination .pg_wrap {
    display: inline-block !important;
    margin: 0 auto !important;
    position: relative !important;
}

.platfmgmt-pagination .pg {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: inline-block !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.platfmgmt-pagination .pg_page,
.platfmgmt-pagination .pg_start,
.platfmgmt-pagination .pg_end,
.platfmgmt-pagination .pg_next,
.platfmgmt-pagination .pg_prev {
    display: inline-block !important;
    margin: 0 3px !important;
    font-size: 14px !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

.platfmgmt-pagination .pg a,
.platfmgmt-pagination .pg strong {
    display: inline-block !important;
    padding: 10px 14px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #007bff !important;
    background: #fff !important;
    font-weight: normal !important;
    line-height: 1.2 !important;
    min-width: 40px !important;
    height: 40px !important;
    text-align: center !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    transition: all 0.2s ease !important;
}

.platfmgmt-pagination .pg a:hover {
    background: #e9ecef !important;
    color: #0056b3 !important;
    border-color: #adb5bd !important;
}

.platfmgmt-pagination .pg strong,
.platfmgmt-pagination .pg .pg_current strong,
.platfmgmt-pagination .pg .pg_current {
    font-weight: bold !important;
    color: #fff !important;
    background: #007bff !important;
    border-color: #007bff !important;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3) !important;
}

.platfmgmt-pagination .pg .sound_only {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* 페이징 컨테이너 추가 안정성 */
.platfmgmt-pagination::before,
.platfmgmt-pagination::after {
    content: "";
    display: table;
    clear: both;
}

.platfmgmt-pagination * {
    box-sizing: border-box !important;
}

/* 반응형 대응 */
@media (max-width: 768px) {
    .platfmgmt-pagination {
        padding: 15px 10px 30px 10px !important;
        margin: 30px auto 40px auto !important;
    }

    .platfmgmt-pagination .pg a,
    .platfmgmt-pagination .pg strong {
        padding: 8px 10px !important;
        min-width: 35px !important;
        height: 35px !important;
        font-size: 13px !important;
        margin: 0 2px !important;
    }
}

/* 그누보드 기본 페이징 스타일 재정의 방지 */
.platfmgmt-pagination .pg li {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.platfmgmt-pagination .pg .pg_page a,
.platfmgmt-pagination .pg .pg_start a,
.platfmgmt-pagination .pg .pg_end a,
.platfmgmt-pagination .pg .pg_next a,
.platfmgmt-pagination .pg .pg_prev a {
    margin: 0 3px !important;
    padding: 10px 14px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #007bff !important;
    text-decoration: none !important;
    display: inline-block !important;
    min-width: 40px !important;
    height: 40px !important;
    text-align: center !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    transition: all 0.2s ease !important;
}

.platfmgmt-pagination .pg .pg_page a:hover,
.platfmgmt-pagination .pg .pg_start a:hover,
.platfmgmt-pagination .pg .pg_end a:hover,
.platfmgmt-pagination .pg .pg_next a:hover,
.platfmgmt-pagination .pg .pg_prev a:hover {
    background: #e9ecef !important;
    color: #0056b3 !important;
    border-color: #adb5bd !important;
}

/* === Misc & Specifics === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: white; padding: 25px; border-radius: 8px; border: 1px solid #e9ecef; text-align: center; }
.stat-number { font-size: 32px; font-weight: bold; color: #007bff; }
.stat-label { color: #6c757d; font-size: 14px; margin-top: 5px; }
.empty-table { text-align: center; padding: 50px; color: #6c757d; }

/* View Page */
.tbl_view th { width: 180px; }
.form-section-title { font-size: 18px; font-weight: 600; color: #007bff; margin-top: 40px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #007bff; }
.view-content { padding: 20px; border: 1px solid #e9e9e9; border-radius: 4px; background: #fff; line-height: 1.7; }
.view-content img, .view-content iframe { max-width: 100%; height: auto; }

/* Tag Styles */
.tag { display: inline-block; background-color: #e9ecef; color: #495057; padding: 4px 8px; border-radius: 4px; font-size: 0.9em; margin: 0 5px 5px 0; }

/* Business Category UI */
.biz-category-row { display: grid; grid-template-columns: 1fr 1fr 2fr auto; gap: 15px; align-items: flex-end; padding: 15px; border: 1px solid #e9e9e9; border-radius: 4px; margin-bottom: 10px; background-color: #fdfdfd; }
.biz-category-row .form-group { margin-bottom: 0; }
.tag-checkbox-container { border: 1px solid #ced4da; border-radius: 4px; padding: 10px; height: 120px; overflow-y: auto; background-color: #fff; }
.tag-checkbox-container label { display: block; margin-bottom: 5px; font-weight: normal; cursor: pointer; }
.tag-checkbox-container label input { margin-right: 8px; }
.biz-category-view-list { list-style-type: none; padding: 0; }
.biz-category-view-list li { padding: 10px; border-bottom: 1px solid #f0f0f0; }
.biz-category-view-list li:last-child { border-bottom: none; }
.biz-category-view-list .tags-list { margin-top: 8px; padding-left: 10px; }

/* List Page Category Row */
.table .category-row td { background-color: #f8f9fa; font-size: 0.9em; color: #555; border-bottom: 2px solid #dee2e6; padding: 8px 15px; }
.category-label {
    font-weight: 600;
    color: #007bff;
    margin-right: 8px;
}

.tag-label {
    font-weight: 600;
    color: #17a2b8;
    margin-right: 8px;
}

.tag-item {
    display: inline-block;
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    margin: 0 3px 3px 0;
    border-radius: 12px;
    font-size: 0.85em;
    border: 1px solid #bbdefb;
    font-weight: 500;
}

/* Small Button Variant */
.pm-btn-sm {
    height: 32px;
    font-size: 13px !important;
    padding: 0 10px;
}


/* Postcode Layer */
#postcode_layer { display: none; position: fixed; top: 50%; left: 50%; width: 400px; height: 500px; border: 2px solid #000; background: #fff; transform: translate(-50%, -50%); z-index: 1000; padding: 10px; }
#btn_close_postcode { position: absolute; top: 5px; right: 5px; cursor: pointer; font-size: 16px; font-weight: bold; background: #333; color: #fff; border: none; padding: 2px 8px; border-radius: 50%; }

/* Responsive */
@media (max-width: 992px) {
    .biz-category-row { grid-template-columns: 1fr 1fr; }
    .biz-category-row .tag-group { grid-column: 1 / 3; }
}
@media (max-width: 768px) {
    .container { padding: 0 15px; }
    .header .container { flex-direction: column; align-items: flex-start; }
    .header .nav { margin-top: 10px; }
    .search-form { flex-direction: column; align-items: stretch; }
    .table { font-size: 13px; }
    .stats-grid { grid-template-columns: 1fr; }
}
