/* Mabinogi DPS Ranking Plugin Styles */ 

/* ==========================================================================
   Theme Variables & Dark Mode
   ========================================================================== */
:root {
    --primary-color: #F65606;
    --background-color: #ffffff;
    --text-color: #333333;
    --text-color-light: #555555;
    --card-background: #ffffff;
    --border-color: #dddddd;
    --header-bg: #ffffff;
    --header-text: #333333;
    --button-bg: #2BAF7E;
    --button-text: #ffffff;
    --link-color: #007bff;
    --link-hover-color: #F65606;
    --input-bg: #ffffff;
    --input-text: #333333;
    --input-border: #ccc;
    --table-header-bg: #f2f2f2;
    --table-row-even-bg: #f9f9f9;
}

body.dark-mode {
    --background-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-color-light: #bbbbbb;
    --card-background: #2c2c2c;
    --border-color: #444444;
    --header-bg: #2c2c2c;
    --header-text: #e0e0e0;
    --link-color: #4dabf7;
    --link-hover-color: #ff7a29;
    --input-bg: #2c2c2c;
    --input-text: #e0e0e0;
    --input-border: #555555;
    --table-header-bg: #3c3c3c;
    --table-row-even-bg: #333333;
}

#site-header {
    display: none;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */
body {
    /* 다크모드 추가
    background-color: var(--background-color); 
    color: var(--text-color);
    /* Add padding to prevent content from being hidden by the sticky header */
    /* The value should be slightly more than the header's height */
    padding-top: 8vh !important; 
}

#mdr-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 5px 20px;
    position: fixed; /* Use fixed positioning */
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    box-sizing: border-box;
}

.mdr-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.mdr-logo img {
    max-height: 50px; /* Controls the height of the header */
    width: auto;
    display: block;
}

.mdr-nav-set {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mdr-login-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: flex-end;
    gap: 10px; /* Spacing between menu items */ 
}

.mdr-login-nav a {
    text-decoration: none;
    color: var(--header-text);
    font-weight: 500;
    font-size: 16px;
    transition: color 0.2s;
}

.mdr-login-nav a:hover {
    color: var(--link-hover-color); /* Theme color */
}

.mdr-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: flex-start;
    gap: 25px; /* Spacing between menu items */
}

.mdr-nav a {
    text-decoration: none !important;
    color: var(--header-text);
    font-weight: 500;
    font-size: 20px;
    transition: color 0.2s;
}

.mdr-nav a:hover {
    color: var(--link-hover-color); /* Theme color */
}


.mdr-login-form {
    max-width: 400px;
    margin: 20px auto;
    border: 1px solid var(--border-color);
    padding: 20px;
}

/* Character Info Page Styles */
.mdr-character-info-container {
    max-width: 960px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--card-background);
}

.character-profile {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.character-image {
    margin-right: 30px;
}

.character-image img {
    max-width: 150px;
    height: auto;
    border-radius: 50%;
    border: 3px solid #eee;
}

.character-details h2 {
    margin: 0 0 10px 0;
    font-size: 2em;
}

.character-details p {
    margin: 5px 0;
    font-size: 1.1em;
    color: var(--text-color);
}

.character-stats, .character-equipment, .character-extra-info {
    margin-bottom: 20px;
}

.mdr-stats-table {
    width: 100%;
    border-collapse: collapse;
}

.mdr-stats-table th, .mdr-stats-table td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.mdr-stats-table th {
    background-color: var(--table-header-bg);
    width: 200px;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
}

.equipment-slot {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
}

.slot-name {
    font-weight: bold;
    color: #333;
}

.item-name {
    color: #005aee;
}

.character-extra-info {
    display: flex;
    gap: 20px;
}

.info-section {
    flex: 1;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* Mabinogi DPS Ranking Plugin Custom Styles */
.mdr-form-errors {
    color: #dc3232;
    border: 1px solid #dc3232;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.mdr-form-errors ul {
    margin: 0;
    padding-left: 20px;
}

.error-message {
    color: #dc3232;
    font-size: 0.9em;
    margin-top: 5px;
}

.success-message {
    color: #0073aa; /* WordPress blue */
    font-size: 0.9em;
    margin-top: 5px;
}

#mdr-ranking-wrapper {
    margin-top: 20px;
}

#mdr-filters-and-search-form {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

/* Hall of Fame Styles */
.mdr-hall-of-fame {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.mdr-hall-of-fame h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px; /* 폰트 크기 조정 */
    margin-bottom: 20px;
}

.mdr-hall-of-fame h3::before,
.mdr-hall-of-fame h3::after {
    content: '';
    display: inline-block;
    width: 50px; /* 이미지 너비 */
    height: 50px; /* 이미지 높이 */
    background-size: contain;
    background-repeat: no-repeat;
    margin: 0 15px; /* 이미지와 텍스트 사이 여백 */
}

.mdr-hall-of-fame h3::before {
    background-image: url('../images/hall-of-fame-prefix.png');
}

.mdr-hall-of-fame h3::after {
    background-image: url('../images/hall-of-fame-suffix.png');
}

.hall-of-fame-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 20px;
}
.hall-of-fame-item {
    position: relative;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.hall-of-fame-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.hall-of-fame-item .rank-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: transparent;
    color: #111111;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    z-index: 999;
}
.hall-of-fame-item .character-info .character-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #1e90ff;
}
.hall-of-fame-item .character-info .character-name a {
    text-decoration: none;
    color: #1e90ff;
}
.hall-of-fame-item .character-info div {
    margin-top: 5px;
    font-size: 0.9em;
    color: #555;
}

.mdr-hall-of-fame .hall-of-fame-item .character-info .character-name a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

.mdr-hall-of-fame .hall-of-fame-item .character-info .character-name a:hover {
    color: #1e90ff; /* Or any color that fits your theme */
    text-decoration: underline;
}

.mdr-hall-of-fame .hall-of-fame-item .character-info .dps {
    font-size: 0.9em;
    color: #c0392b; /* A red color for DPS */
    font-weight: bold;
}

/* Correct Hall of Fame Image Styles */
.mdr-hall-of-fame .character-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 10px;
    overflow: hidden;
    border: 3px solid #e0a800; /* Gold border for prestige */
    background-color: #f8f9fa; /* Light background for the circle */
    display: flex;
    align-items: center;
    justify-content: center;
}

.mdr-hall-of-fame .character-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the area, cropping if necessary */
}

.mdr-hall-of-fame .character-image .no-image {
    font-size: 0.8em;
    color: #6c757d;
}

/* Ranking Table Styles */
.mdr-ranking-table table {
    margin-top: 30px;
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-background);
}

.mdr-ranking-table table th, .mdr-ranking-table table td {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.mdr-ranking-table table tbody tr:nth-child(even) {
    background-color: var(--table-row-even-bg);
}

.mdr-ranking-table table th {
    background-color: var(--table-header-bg);
    width: 200px;
}

.mdr-ranking-table td {
    background-color: transparent !important;
}

.mdr-ranking-table td a {
    color: #1e90ff;
    text-decoration: none;
}

.mdr-ranking-table td a:hover {
    text-decoration: underline;
}

/* Character Input Form Styles */
#mdr-character-input-form .form-group {
    margin-bottom: 20px;
}

#mdr-character-input-form .form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

/* --- Unified Input and Select2 Styles --- */
#mdr-character-input-form .form-group input[type="text"],
#mdr-character-input-form .form-group input[type="number"],
#mdr-character-input-form .form-group input[type="file"],
#mdr-character-input-form .form-group textarea,
#mdr-character-input-form .form-group .select2-container .select2-selection--single {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    box-sizing: border-box; /* Crucial for consistent sizing */
    color: var(--input-text);
    background-color: var(--input-bg);
}

#mdr-character-input-form .form-group input[type="text"],
#mdr-character-input-form .form-group input[type="number"],
#mdr-character-input-form .form-group .select2-container .select2-selection--single {
    height: 42px; /* Enforce uniform height */
}

#mdr-character-input-form .select2-container .select2-selection--single {
    display: flex;
    align-items: center; /* Vertically center text in Select2 */
}
/* --- End of Unified Styles --- */

#mdr-character-input-form textarea {
    resize: vertical;
}

#mdr-character-input-form .form-row {
    display: flex;
    gap: 20px;
}

#mdr-character-input-form .form-row .form-group {
    flex: 1;
}

#mdr-character-input-form .horizontal-selects {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#mdr-character-input-form .horizontal-selects > .select2-container {
    flex: 1 1 calc(33.333% - 10px);
}

#mdr-character-input-form .form-submit-row {
    text-align: right;
    margin-top: 30px;
}

#mdr-submit-btn {
    padding: 12px 25px;
    background-color: #F65606;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#mdr-submit-btn:hover {
    background-color: #ff2600;
}

/* Skill Modification styles */
#mdr-skill-modification {
    margin-top: 10px;
    gap: 15px;
}
.skill-mod-item {
    flex: 1 1 calc(16.666% - 15px);
    display: flex;
    flex-direction: column;
}
.skill-mod-item label {
    font-size: 13px;
    margin-bottom: 5px;
    text-align: center;
    color: #555;
}
.skill-mod-item input {
    text-align: center;
}
#skill-mod-total {
    margin-top: 10px;
    font-weight: bold;
    text-align: right;
    color: #333;
}
#skill-mod-total span {
    font-size: 1.2em;
}

/* Character Info Page - Skill Display */
.skill-modification-grid {
    margin-top: 20px;
    margin-bottom: 20px;
}
.skill-row {
    display: flex;
    justify-content: center;
    gap: 40px; /* 원 사이의 간격 */
    margin-bottom: 10px;
}
.top-row {
    margin-left: 50px; /* 지그재그 효과 */
}
.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.skill-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #f0f8ff;
    border: 2px solid #add8e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: bold;
    color: #c0392b;
    margin-bottom: 10px;
}
.skill-label {
    font-size: 1em;
    color: #333;
    font-weight: 500;
}

.skill-combo-details {
    margin-top: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
    line-height: 1.6;
}

/* Common Page Title Style */
.page-header {
    text-align: center;
    margin-bottom: 30px;
}

/* ==========================================================================
   Content
   ========================================================================== */
.entry-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 20px;
    margin: 0;
    position: relative;
    /* 밑줄 효과를 위한 background 속성 추가 */
    background: linear-gradient(var(--primary-color), var(--primary-color)) center bottom / 30% 3px no-repeat;
}

.entry-title::before,
.entry-title::after {
    content: '';
    display: inline-block;
    width: 100px;
    height: 32px; /* 높이를 font-size에 맞춰 조정 */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center; /* 이미지를 요소 중앙에 위치시킴 */
    margin: 0 15px;
    flex-shrink: 0; /* flex 컨테이너 내에서 크기 유지 */
}

.entry-title::before {
    background-image: url('../images/hall-of-fame-prefix.png');
}

.entry-title::after {
    background-image: url('../images/hall-of-fame-suffix.png');
}

.page-content,
.entry-content,
.entry-summary {
    margin-bottom: 30px;
}

/* Character Info Page Specific Styles */
#mdr-character-info-wrapper {
}

#mdr-character-info-title {
    text-align: center;
    margin-bottom: 30px;
}

#mdr-character-info-title h2 {
    font-size: 2.5em;
    font-weight: 700;
    color: #333;
    border-bottom: 3px solid #F65606;
    display: inline-block;
    padding-bottom: 10px;
    margin: 0;
}

.character-profile-header {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    padding: 20px 10px;
    margin-bottom: 20px;
}

.character-profile-header .character-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
}

.character-profile-header .character-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-summary h2 {
}

.character-summary .server-class {
    font-size: 1.2em;
    color: #333;
    margin: 5px 0 15px;
}

.character-summary .main-stats-new {
    margin-top: 15px;
}

.main-stats-new .stat-line {
    font-size: 1.2em;
    margin: 5px 0;
    color: #333;
}

.main-stats-new .stat-number {
    color: #c0392b;
}

.character-details {
    margin-bottom: 25px; /* Added vertical margin */
}

.character-details h3 {
    margin-bottom: 15px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

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

.equipment-item {
    background: #fff;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.equipment-name-clickable {
    cursor: pointer;
    background-color: #F65606;
    padding: 5px 10px;
    border-radius: 10px;
    color: #fff;
    transition: color 0.2s;
}

.equipment-name-clickable:hover {
    background-color: #ff2600;
}

/* Item Info Modal Styles */
#mdr-item-info-modal {
    max-width: 420px;
    width: calc(100vw - 40px);
    background: #18181b; /* Dark background */
    color: #e0e0e0;
    border-radius: 24px;
    padding: 0;
    border: 2px solid;
    box-shadow: 0 0 40px 10px;
    overflow: visible; /* For corner ornaments */
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* Grade-specific Themes */
#mdr-item-info-modal.grade-전설 {
    border-color: #CE6026;
    box-shadow: 0 0 40px 10px rgba(206, 96, 38, 0.6);
}
#mdr-item-info-modal.grade-에픽 {
    border-color: #8A2BE2;
    box-shadow: 0 0 40px 10px rgba(138, 43, 226, 0.6);
}
#mdr-item-info-modal.grade-유니크 {
    border-color: #f0e68c;
    box-shadow: 0 0 40px 10px rgba(240, 230, 140, 0.6);
}

#mdr-item-info-modal::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.mdr-modal-content {
    padding: 28px 24px;
    position: relative;
}

.mdr-modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent !important;
    border: none !important;
    outline: none; /* Remove focus outline */
    color: #ddd;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    padding: 0;
    z-index: 10;
}
.mdr-modal-close-btn:hover {
    color: #fff;
    transform: scale(1.1);
    background: transparent !important;
    border: none !important;
    outline: none; /* Remove focus outline */
}

.mdr-modal-item-stars {
    font-size: 1.5em;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-align: center;
}
.grade-전설 .mdr-modal-item-stars,
.grade-에픽 .mdr-modal-item-stars {
    color: #FFD700;
}

.mdr-modal-item-name {
    font-size: 1.7em;
    font-weight: 700;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}
.grade-전설 .mdr-modal-item-name { color: #CE6026; }
.grade-에픽 .mdr-modal-item-name { color: #9D65E4; }
.grade-유니크 .mdr-modal-item-name { color: #FFFACD; }

.mdr-modal-item-subtitle {
    text-align: center;
    font-size: 1.1em;
    color: #bbb;
    margin: 4px 0 16px 0;
}

.mdr-subtitle-grade {
    font-weight: bold;
}
.grade-전설 .mdr-subtitle-grade { color: #CE6026; }
.grade-에픽 .mdr-subtitle-grade { color: #9D65E4; }
.grade-유니크 .mdr-subtitle-grade { color: #FFFACD; }

.mdr-modal-hr {
    border: none;
    height: 1.5px;
    background-color: rgba(255, 255, 255, 0.15);
    margin: 20px 0;
}

.mdr-modal-section {
    margin-bottom: 16px;
    line-height: 1.6;
}

.mdr-modal-effect {
    font-size: 1.1em;
}

.mdr-effect-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
    color: #18181b;
    margin-right: 8px;
}

.grade-전설 .mdr-effect-badge { background-color: #CE6026; }
.grade-에픽 .mdr-effect-badge { background-color: #8A2BE2; }
.grade-유니크 .mdr-effect-badge { background-color: #f0e68c; }

.mdr-modal-description {
    color: #ccc;
    font-size: 1em;
    white-space: pre-wrap;
}

.mdr-modal-loading {
    text-align: center;
    padding: 60px 0;
    font-size: 1.2em;
    color: #888;
}

/* Modal Open/Close Animation */
#mdr-item-info-modal[open] {
  animation: fadeIn 0.3s ease-out;
}
#mdr-item-info-modal.closing {
  animation: fadeOut 0.3s ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.98); }
}


/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    #mdr-character-input-form .form-row,
    #mdr-character-input-form .horizontal-selects {
        flex-direction: column;
        gap: 0;
    }
    #mdr-character-input-form .horizontal-selects > * {
        margin-bottom: 10px;
    }
} 

/* === Character Input Page Final Overrides (Append to end of file) === */

/*
 * Force consistent height and styling for all standard input fields and Select2.
 * Using high specificity to ensure these rules apply over existing ones.
 */
#mdr-character-input-form .form-group input[type="text"],
#mdr-character-input-form .form-group input[type="number"],
#mdr-character-input-form .select2-container .select2-selection--single {
    height: 42px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
}

#mdr-character-input-form .select2-container .select2-selection__rendered {
    line-height: 40px !important;
}

#mdr-character-input-form .select2-container .select2-selection__arrow {
    height: 40px !important;
}

/* Ensure textarea is not affected by height override */
#mdr-character-input-form .form-group textarea {
    height: auto !important;
} 

/* === FINAL LAYOUT STYLES (Previously injected via JS) === */

/* --- General Button & Title Alignment --- */
.mdr-ranking-header, .mdr-add-character-link-top { 
    text-align: right; 
}
#mdr-my-characters-wrapper h2 { 
    text-align: center; 
}
.button.primary {
    font-size: 1.1em !important;
    font-weight: bold !important;

}
.button.primary:hover {
    color: #e9165c !important;
}
.mdr-ranking-header h2 { 
    text-align: center; 
    flex-grow: 1; 
    border-bottom: 3px solid #F65606;
}

/* --- Ranking Page: Filters --- */
.mdr-filter-area { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; 
    align-items: flex-end; 
    gap: 20px; 
    margin-bottom: 30px; 
}
.mdr-select-area { 
    display: flex; 
    gap: 20px; 
    flex-grow: 1; 
}
.mdr-select-server, .mdr-select-class { 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
}
.mdr-search-character { 
    position: relative; 
}
.mdr-search-character input[type="text"] { 
    padding-right: 40px !important; 
}
.mdr-search-character .mdr-search-btn { 
    position: absolute; 
    right: 0; 
    top: 0; 
    bottom: 0; 
    width: 40px; 
    border: none; 
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3e%3ccircle cx='11' cy='11' r='8'/%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'/%3e%3c/svg%3e") no-repeat center; 
    cursor: pointer; 
    text-indent: -9999px; 
}
.mdr-search-character .mdr-search-btn:hover {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='8'%3e%3c/circle%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'%3e%3c/line%3e%3c/svg%3e") no-repeat center;
}

/* --- Ranking Page: Modern Pagination --- */
.mdr-pagination-modern { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 8px; 
    margin-top: 20px; 
}
.mdr-pagination-modern .pagination-btn { 
    width: 36px; 
    height: 36px; 
    padding: 0; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    background-color: #333; 
    cursor: pointer; 
    mask-repeat: no-repeat; 
    mask-position: center; 
    mask-size: 50%; 
}
.mdr-pagination-modern .pagination-btn:hover:not(:disabled) { 
    background-color: #000; 
}
.mdr-pagination-modern .pagination-btn:disabled { 
    background-color: #ccc; 
    cursor: not-allowed; 
    opacity: 0.6; 
}
.mdr-pagination-modern .page-indicator { 
    padding: 0 12px; 
}
.mdr-pagination-modern .page-indicator .current-page { 
    font-weight: bold; 
}
.mdr-pagination-modern .pagination-btn.first-page { 
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z'/%3e%3c/svg%3e"); 
}
.mdr-pagination-modern .pagination-btn.prev-page { 
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6z'/%3e%3c/svg%3e"); 
}
.mdr-pagination-modern .pagination-btn.next-page { 
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6z'/%3e%3c/svg%3e"); 
}
.mdr-pagination-modern .pagination-btn.last-page { 
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z'/%3e%3c/svg%3e"); 
}

/* ==========================================================================
   My Characters Page
   ========================================================================== */
   .mdr-add-character-link-top {
    margin-bottom: 0px;
    text-align: right;
}

.my-characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.my-character-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.my-character-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.my-character-item .character-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 10px;
    overflow: hidden;
    border: 3px solid #eee;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-character-item .character-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.my-character-item .character-image .no-image {
    font-size: 0.8em;
    color: #6c757d;
}

.my-character-item .character-info {
    flex-grow: 1;
    margin-bottom: 15px;
}

.my-character-item .character-name {
    font-weight: bold;
    font-size: 1.1em !important;
    margin-bottom: 8px;
}

.my-character-item .character-name a {
    text-decoration: none;
    color: #1e90ff;
    transition: color 0.3s;
}

.my-character-item .character-name a:hover {
    color: #1e90ff;
    text-decoration: underline;
}

.my-character-item .character-info div {
    margin-top: 4px;
    font-size: 1em;
    color: rgb(51, 51, 51);
}

.my-character-item .dps {
    font-weight: bold;
    color: #c0392b !important;
}

.my-character-item .character-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.my-character-item .character-actions .button {
    flex-grow: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.9em;
}

.my-character-item .character-actions .button:hover {
    color: #e9165c !important;
}

/* --- Character Input Page: Horizontal Selects --- */
#mdr-character-input-form .horizontal-selects { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
}
#mdr-character-input-form .horizontal-selects .select2-container { 
    flex: 1 1 150px; 
    min-width: 150px; 
}

/* --- Character Input Page: Image Cropper --- */
#mdr-cropper-ui { /* The main container for editor and preview */
    display: flex;
    align-items: center;
    justify-content: center; /* Center the items if they don't fill the space */
    gap: 30px; /* Space between editor and preview */
    padding: 10px;
    border-radius: 5px;
    background-color: #f8f9fa; /* Light background for the container */
}

#mdr-cropper-ui .cropper-main {
    width: 400px; /* A good size for the editor */
    height: 400px;
}

#mdr-cropper-ui .cropper-preview-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#mdr-cropper-ui .cropper-preview-circle {
    width: 320px; /* Make preview same size as editor */
    height: 320px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ddd;
}

/* Make the crop box visually circular */
.cropper-view-box,
.cropper-face {
    border-radius: 50%;
}

/* --- Character Input Page: Skill Modification --- */
#mdr-skill-modification {
    gap: 15px;
}
.skill-mod-item {
    flex: 1 1 calc(16.666% - 15px);
    display: flex;
    flex-direction: column;
}
.skill-mod-item label {
    font-size: 13px;
    margin-bottom: 5px;
    text-align: center;
    color: #555;
}
.skill-mod-item input {
    text-align: center;
}
#skill-mod-total {
    margin-top: 10px;
    font-weight: bold;
    text-align: right;
    color: #333;
}
#skill-mod-total span {
    font-size: 1.2em;
}

/* Rune Stats Page */
#mdr-rune-stats-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    font-family: sans-serif;
}

#mdr-stats-filters {
    margin-bottom: 20px;
    text-align: center;
}

.mdr-filter-btn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 8px 15px;
    cursor: pointer;
    margin: 0 5px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.mdr-filter-btn:hover {
    background: #e0e0e0;
}

.mdr-filter-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.mdr-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.mdr-class-stats-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.mdr-class-title {
    margin-top: 0;
    font-size: 1.5em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.mdr-class-total {
    font-size: 0.7em;
    color: #666;
    font-weight: normal;
}

.mdr-stats-section h4 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.mdr-equipment-stats {
    margin-bottom: 15px;
}

.mdr-equipment-stats strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.mdr-equipment-stats ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mdr-equipment-stats li {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.mdr-item-name {
    width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.mdr-bar-container {
    flex-grow: 1;
    height: 18px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin: 0 10px;
}

.mdr-bar {
    height: 100%;
    background-color: var(--button-bg);
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}

.mdr-item-percentage {
    width: 50px;
    text-align: right;
    font-weight: bold;
    color: #495057;
}

.mdr-skill-mods-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

.mdr-skill-mod-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
}

.mdr-skill-num {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
}

.mdr-skill-val {
    display: block;
    font-size: 1.4em;
    font-weight: bold;
}

.mdr-skill-val.mdr-skill-zero {
    color: var(--text-color-light);
}

.mdr-skill-val.mdr-skill-non-zero {
    color: var(--button-bg);
}

/* --- Rune Stats Page --- */
.mdr-page-description {
    text-align: right;
    font-size: 14px;
    color: var(--text-color-light);
    margin-bottom: 10px;
}

.mdr-skill-layout-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px; /* 아이템 사이의 간격 */
}

.mdr-skill-build-separator {
    border: 0;
    height: 1px;
    background-color: #ddd;
    margin: 15px 0;
}

#mdr-stats-filters {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.mdr-filter-group-period, .mdr-filter-group-class-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mdr-period-filter-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
}

#mdr-stats-filters h4 {
    margin: 0 0 5px;
    font-size: 16px;
    color: var(--header-text);
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.mdr-filter-group-period .mdr-period-filter-btn, .mdr-class-filter-btn {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    text-align: center;
    color: var(--text-color) !important;
    font-weight: bold;
}

.mdr-filter-group-period .mdr-period-filter-btn:hover, .mdr-class-filter-btn:hover {
    background-color: var(--primary-color);
    color: #fff !important;
    border-color: var(--primary-color);
    font-weight: bold;
}

.mdr-filter-group-period .mdr-period-filter-btn.active, .mdr-class-filter-btn.active {
    background-color: var(--primary-color);
    color: #fff !important;
    border-color: var(--primary-color);
    font-weight: bold;
}

.mdr-filter-group-class {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.mdr-class-category h5 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #555;
}

.mdr-class-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 필터링 시 통계 카드 너비 조정 */
#mdr-stats-content.filter-active .mdr-stats-grid {
    display: flex;
    justify-content: center;
}

#mdr-stats-content.filter-active .mdr-class-stats-card {
    flex-basis: 100%; /* 부모 컨테이너에 맞춰 너비를 채우도록 설정 */
    max-width: 500px; /* 카드의 최대 너비를 제한하여 너무 커지지 않게 함 */
}

/* 룬 통계 페이지 아이템 이름 클릭 시 효과 */
.mdr-item-name.equipment-name-clickable {
    cursor: pointer;
    background-color: transparent;
    padding: 5px 10px;
    border-radius: 10px;
    color: var(--link-color);
    transition: color 0.2s;
}

.mdr-item-name.equipment-name-clickable:hover {
    color: var(--link-hover-color);
}