:root {
    /* CRYSTAL GLASS V3 (Cyan/Purple/Glass) */
    /* Dreamy Pastel Mesh Animation as default */
    --bg-gradient: linear-gradient(-45deg, #e0c3fc, #8ec5fc, #fbc2eb, #a18cd1);
    --bg-size: 400% 400%;
    --bg-animation: gradientBG 15s ease infinite;
    --bg-attachment: fixed;

    --text-main: #ffffff;
    --text-subtitle: rgba(255, 255, 255, 0.85);
    --text-hint: #e0e0e0;

    --header-gradient: rgba(255, 255, 255, 0.05);

    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-hover: rgba(255, 255, 255, 0.2);

    --primary-gradient: linear-gradient(90deg, #89f7fe 0%, #66a6ff 100%);
    /* Cyan Blue from modal */
    --primary-shadow: rgba(0, 0, 0, 0.2);

    --accent-color: #00c6ff;
    --accent-border: rgba(0, 198, 255, 0.4);

    --input-bg: rgba(0, 0, 0, 0.2);
    --input-border: rgba(255, 118, 117, 0.4);
    /* Kept consistent with earlier tweaks, or reset? adhering to crystal defaults logic */

    --card-bg: rgba(255, 255, 255, 0.08);

    --th-border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    --tr-border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    --bg-size: 100% 100%;
    --bg-animation: none;

    --text-main: #2d3436;
    --text-subtitle: #636e72;
    --text-hint: #0984e3;

    --header-gradient: linear-gradient(90deg, #0984e3, #6c5ce7);

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.9);

    --primary-gradient: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    --primary-shadow: rgba(9, 132, 227, 0.3);

    --accent-color: #0984e3;
    --accent-border: rgba(9, 132, 227, 0.3);

    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(0, 0, 0, 0.15);

    --card-bg: rgba(255, 255, 255, 0.8);

    --th-border-bottom: 2px solid rgba(9, 132, 227, 0.5);
    --tr-border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="midnight"] {
    --bg-gradient: #000000;
    --bg-size: 100% 100%;
    --bg-animation: none;

    --text-main: #ffffff;
    --text-subtitle: #b2bec3;
    --text-hint: #2ecc71;

    --header-gradient: linear-gradient(90deg, #ffffff, #b2bec3);

    --glass-bg: #1a1a1a;
    --glass-border: #333333;
    --glass-hover: #2d2d2d;

    --primary-gradient: #2d2d2d;
    --primary-shadow: rgba(255, 255, 255, 0.1);

    --accent-color: #ffffff;
    --accent-border: #666666;

    --input-bg: #1a1a1a;
    --input-border: #333333;

    --card-bg: #121212;

    --th-border-bottom: 2px solid #ffffff;
    --tr-border-bottom: 1px solid #333333;
}

[data-theme="sunset"] {
    --bg-gradient: linear-gradient(135deg, #2b1055, #7597de);
    --bg-size: 100% 100%;
    --bg-animation: none;

    --text-main: #ffeaa7;
    --text-subtitle: #fab1a0;
    --text-hint: #fd79a8;

    --header-gradient: linear-gradient(90deg, #ff7675, #fab1a0);

    --glass-bg: rgba(45, 52, 54, 0.6);
    --glass-border: rgba(255, 118, 117, 0.3);
    --glass-hover: rgba(45, 52, 54, 0.8);

    --primary-gradient: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
    --primary-shadow: rgba(214, 48, 49, 0.4);

    --accent-color: #fab1a0;
    --accent-border: rgba(250, 177, 160, 0.4);

    --input-bg: rgba(0, 0, 0, 0.3);
    --input-border: rgba(255, 118, 117, 0.4);

    --card-bg: rgba(0, 0, 0, 0.4);

    --th-border-bottom: 2px solid #fab1a0;
    --tr-border-bottom: 1px solid rgba(255, 118, 117, 0.2);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    /* Use variables for logic-based theming */
    background: var(--bg-gradient);
    background-size: var(--bg-size);
    animation: var(--bg-animation);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100%;
    margin: 0;
    padding: 0;
    transition: background 0.5s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 15px;
    animation: fadeIn 0.8s ease-in;
}

header h1 {
    font-size: 1.2rem;
    background: var(--header-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-subtitle);
    font-size: 0.90rem;
}

.hint {
    color: var(--text-hint);
    font-size: 0.85rem;
    margin-top: 5px;
    font-style: italic;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    animation: slideDown 0.6s ease-out;
}

.nav-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    color: var(--text-subtitle);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--glass-hover);
    border-color: var(--accent-border);
}

.nav-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 5px 20px var(--primary-shadow);
}

/* Theme Switcher */
.theme-switch-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-select {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.theme-select option {
    background: #2d2d2d;
    color: #ffffff;
}

[data-theme="light"] .theme-select option {
    background: #ffffff;
    color: #000000;
}

/* Mode Containers */
.mode-container {
    animation: fadeIn 0.5s ease-in;
}

/* Controls */
.controls {
    max-width: 700px;
    margin: 0 auto 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .controls {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    /* ?이??모드 그림???하?*/
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap;
}

.sort-controls label {
    color: var(--text-subtitle);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.sort-select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:hover {
    border-color: var(--accent-color);
}

.sort-select option {
    background: #2d2d2d;
    color: #ffffff;
}

[data-theme="light"] .sort-select option {
    background: #ffffff;
    color: #000000;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 700px;
    margin: 0 auto 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.6s ease-out;
}

[data-theme="light"] .search-box {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

#searchInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1.1rem;
    padding: 15px 25px;
}

#searchInput::placeholder {
    color: var(--text-subtitle);
    opacity: 0.7;
}

#searchBtn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--primary-shadow);
}

.loading {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.3s ease-in;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--text-hint);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.results {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease-in;
}

[data-theme="light"] .results {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.results-header h2 {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.export-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(56, 239, 125, 0.3);
}

.table-container {
    overflow-x: clip;
}

table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--glass-bg);
}

th {
    padding: 4px 6px;
    text-align: left;
    color: var(--accent-color);
    font-weight: 600;
    border-bottom: var(--th-border-bottom);
    white-space: nowrap;
    font-size: 0.9rem;
}

tbody tr {
    border-bottom: var(--tr-border-bottom);
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: var(--glass-hover);
    transform: scale(1.005);
}

td {
    padding: 0px 1px;
    color: var(--text-main);
    white-space: nowrap;
    font-size: 0.98rem;
}

/* Reduce font size for # (Index) and Size columns */
td:nth-child(1),
td:nth-child(6) {
    font-size: 0.80rem;
}

.title-cell {
    max-width: 700px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.res-badge {
    background: var(--primary-gradient);
    padding: 2px 0;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    display: inline-block;
    min-width: 50px;
    text-align: center;
}

/* Source Type Badges */
.type-badge {
    padding: 2px 0;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 600;
    display: inline-block;
    min-width: 48px;
    text-align: center;
}

.type-remux {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.type-webdl {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.type-encode {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: #0f0c29;
}

.type-audio {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #0f0c29;
}

.type-tvrip {
    background: linear-gradient(135deg, #ff9966 0%, #ff5e62 100%);
    color: white;
}

.type-others {
    background: linear-gradient(135deg, #bdc3c7 0%, #2c3e50 100%);
    color: white;
}

.type-temp {
    background: linear-gradient(135deg, #20bf55 0%, #01baef 100%);
    color: white;
}


.copy-btn {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 3px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.7rem;
}

.copy-btn:hover {
    background: var(--accent-color);
    color: #fff;
    /* 만약 배경??이 밝으??글??색 조정 ??요??????으??무난??*/
}

[data-theme="light"] .copy-btn:hover {
    color: #fff;
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    font-size: 1.3rem;
    color: var(--text-subtitle);
    animation: fadeIn 0.5s ease-in;
}

.loading-more {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.3s ease-in;
}

.spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--text-hint);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

.end-message {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-subtitle);
    font-size: 1.1rem;
    animation: fadeIn 0.5s ease-in;
}

.date-cell {
    color: var(--text-subtitle);
    font-size: 0.75rem;
}

/* Editable cells */
.editable {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.editable:hover {
    background: rgba(102, 126, 234, 0.1);
    outline: 1px dashed var(--accent-border);
}

.editable:hover::after {
    content: '???';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.6;
}

.edit-input {
    background: var(--input-bg);
    border: 2px solid var(--text-hint);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}

.edit-input:focus {
    background: var(--glass-hover);
    border-color: var(--accent-color);
}

/* Magnet Search Form */
.magnet-edit-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-subtitle);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
    transition: all 0.3s ease;
}

/* Select element specific */
select.form-input {
    cursor: pointer;
    appearance: none;
    /* Remove default arrow to style custom if needed, but keeping basic for now */
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg%20xmlns="http://www.w3.org/2000/svg"%20width="24"%20height="24"%20viewBox="0/0/24/24"fill="none"stroke="white"stroke-width="2"stroke-linecap="round"stroke-linejoin="round"><polyline%20points="6/9/12/15/18/9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    padding-right: 45px;
}

[data-theme="light"] select.form-input {
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg%20xmlns="http://www.w3.org/2000/svg"%20width="24"%20height="24"%20viewBox="0/0/24/24"fill="none"stroke="black"stroke-width="2"stroke-linecap="round"stroke-linejoin="round"><polyline%20points="6/9/12/15/18/9"></polyline></svg>');
}

/* Option visibility fix */
.form-input option {
    background-color: #2d2d2d;
    /* Solid background for dark mode options */
    color: #ffffff;
}

[data-theme="light"] .form-input option {
    background-color: #ffffff;
    color: #000000;
}

[data-theme="midnight"] .form-input option {
    background-color: #1a1a1a;
    color: #ffffff;
}

[data-theme="sunset"] .form-input option {
    background-color: #2d3436;
    color: #ffffff;
}

.form-input:focus {
    background: var(--glass-hover);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.check-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.check-btn:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.check-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-input[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-input textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.update-btn {
    flex: 1;
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.update-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--primary-shadow);
}

.update-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#magnetInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1.1rem;
    padding: 15px 25px;
}

#magnetInput::placeholder {
    color: var(--text-subtitle);
    opacity: 0.7;
}

#magnetSearchBtn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#magnetSearchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px var(--primary-shadow);
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 반응????자??(Mobile Card Layout) */


/* Modal Overlay Styles */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(5px) !important;
    z-index: 10010 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-content {
    position: relative !important;
    background: var(--bg-secondary, #1e293b) !important;
    border-radius: 12px !important;
    padding: 24px !important;
    max-width: 600px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

/* Mini-Modal for simple confirmations/passwords */
.modal-content.modal-mini {
    max-width: 400px !important;
    padding: 20px !important;
    overflow: hidden !important;
    /* Prevent unwanted scrollbars */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary, white);
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-primary, white);
}

/* Compact Modal Layout */
.modal-content-compact {
    max-width: 900px !important;
    padding: 20px !important;
}

.modal-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.modal-left-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-right-column {
    display: flex;
    align-items: flex-start;
}

.form-group-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-compact label {
    color: var(--text-subtitle, #94a3b8);
    font-weight: 600;
    font-size: 0.85rem;
}

.form-input-compact {
    width: 100%;
    background: var(--input-bg, rgba(15, 23, 42, 0.8));
    border: 1px solid var(--input-border, rgba(148, 163, 184, 0.3));
    color: var(--text-main, #e2e8f0);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input-compact:focus {
    background: var(--glass-hover, rgba(30, 41, 59, 0.9));
    border-color: var(--accent-color, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.form-input-compact[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
}

select.form-input-compact {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3csvg%20xmlns="http://www.w3.org/2000/svg"%20width="24"%20height="24"%20viewBox="0%200%2024%2024"%20fill="none"%20stroke="white"%20stroke-width="2"%20stroke-linecap="round"%20stroke-linejoin="round"%3e%3cpolyline%20points="6%209%2012%2015%2018%209"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 35px;
}

/* form-input-compact option visibility */
.form-input-compact option {
    background-color: #2d2d2d;
    color: #ffffff;
}

[data-theme="light"] .form-input-compact option {
    background-color: #ffffff;
    color: #000000;
}

[data-theme="midnight"] .form-input-compact option {
    background-color: #1a1a1a;
    color: #ffffff;
}

[data-theme="sunset"] .form-input-compact option {
    background-color: #2d3436;
    color: #ffffff;
}

.form-row-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.check-btn-compact {
    background: var(--card-bg, #1e293b);
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.3));
    color: var(--text-main, #e2e8f0);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.check-btn-compact:hover:not(:disabled) {
    background: var(--primary-color, #6366f1);
    border-color: var(--primary-color, #6366f1);
    color: white;
}

.check-btn-compact:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Preview Container */
.modal-preview-container {
    width: 100%;
    background: var(--glass-bg, rgba(15, 23, 42, 0.5));
    border: 2px solid var(--glass-border, rgba(148, 163, 184, 0.2));
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.modal-preview-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.modal-preview-image.hidden {
    display: none;
}

.modal-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    /* Changed from height: 100% to allow proper stacking */
    min-height: 300px;
    color: var(--text-subtitle, #94a3b8);
}

.modal-preview-placeholder span {
    font-size: 4rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.modal-preview-placeholder p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.7;
}

.modal-preview-info {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-subtitle, #94a3b8);
    font-size: 0.75rem;
    font-family: monospace;
    text-align: center;
    border-top: 1px solid var(--glass-border, rgba(148, 163, 184, 0.2));
}

.modal-preview-info.hidden {
    display: none;
}

/* Pikpak Body Info Styles */
.modal-body-info {
    margin-top: 6px;
    padding: 4px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

.modal-body-info.hidden {
    display: none;
}

.body-info-item {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.body-info-item:last-child {
    margin-bottom: 0;
}

.body-info-item:hover {
    background: rgba(99, 102, 241, 0.2);
    cursor: pointer;
}

.body-info-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-subtitle, #94a3b8);
    min-width: 35px;
}

.body-info-value {
    font-size: 0.75rem;
    color: var(--text-main, #e2e8f0);
    flex: 1;
    word-break: break-all;
    cursor: pointer;
}

.search-buttons-container {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.search-buttons-container.hidden {
    display: none;
}

.search-title-btn {
    flex: 1;
    padding: 4px 8px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 4px;
    color: var(--text-main, #e2e8f0);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-title-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.6);
}


/* Action Buttons */
.form-actions-compact {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.edit-image-btn {
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 4px;
    color: #10b981;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.edit-image-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.edit-image-btn.hidden {
    display: none;
}

.edit-image-hint {
    margin-top: 5px;
    font-size: 0.7rem;
    color: #a0a0a0;
    text-align: center;
}

.edit-image-hint b {
    color: #10b981;
}

.paste-hint {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 4px;
}

/* Image Editor Modal */
.editor-modal {
    display: none;
    position: fixed;
    z-index: 10020;
    /* Above .modal-overlay (9999) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.editor-content {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 95%;
    max-width: 1100px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.editor-header {
    padding: 15px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.5);
}

.editor-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #f8fafc;
}

.editor-body {
    flex: 1;
    padding: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
}

.editor-body img {
    max-width: 100%;
    max-height: 70vh;
}

.editor-footer {
    padding: 15px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    background: rgba(30, 41, 59, 0.5);
    flex-wrap: wrap;
}

.editor-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.resize-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.resize-input {
    width: 60px;
    background: transparent;
    border: none;
    color: #10b981;
    font-weight: 600;
    text-align: center;
    outline: none;
}

.zoom-controls {
    display: flex;
    gap: 8px;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.editor-btn-group {
    display: flex;
    gap: 12px;
}

.editor-btn {
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-btn-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #94a3b8;
}

.editor-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

.editor-btn-save {
    background: #10b981;
    border: 1px solid #10b981;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.editor-btn-save:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.update-btn-compact,
.open-btn-compact {
    flex: 1;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.update-btn-compact {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.update-btn-compact:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.update-btn-compact:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.open-btn-compact {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--accent-color, #00d4ff);
    color: var(--accent-color, #00d4ff);
}

.open-btn-compact:hover {
    background: var(--accent-color, #00d4ff);
    color: white;
}

/* Mobile Responsive for Compact Modal */
@media (max-width: 768px) {
    .modal-content-compact {
        max-width: 95% !important;
        padding: 15px !important;
    }

    .modal-grid-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modal-preview-container {
        min-height: 200px;
    }

    .form-row-compact {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}


/* Bulk Edit Panel Styles */
.bulk-edit-panel {
    background: var(--glass-bg, rgba(30, 41, 59, 0.7));
    border: 1px solid var(--glass-border, rgba(148, 163, 184, 0.2));
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    max-width: 700px;
    width: 100%;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bulk-edit-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.bulk-edit-fields label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-primary, #e2e8f0);
}

.bulk-edit-fields input[type='checkbox'] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.bulk-edit-fields input[type='text'],
.bulk-edit-fields input[type='date'],
.bulk-edit-fields select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--glass-border, rgba(148, 163, 184, 0.3));
    background: var(--bg-secondary, rgba(15, 23, 42, 0.8));
    color: var(--text-primary, #e2e8f0);
    font-size: 0.9rem;
}

.bulk-update-btn,
.bulk-delete-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.bulk-update-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.bulk-update-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.bulk-delete-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.bulk-delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* Checkbox column styling */
.checkbox-col {
    width: 40px;
    text-align: center;
}

.item-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Bulk Edit Field Groups - Refined Alignment */
.bulk-field-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.bulk-field-group .field-label {
    font-weight: 500;
    min-width: fit-content;
}

.bulk-select,
.bulk-input {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--glass-border, rgba(148, 163, 184, 0.3));
    background: var(--bg-secondary, rgba(15, 23, 42, 0.8));
    color: var(--text-primary, #e2e8f0);
    font-size: 0.9rem;
}

.bulk-input[type='text'] {
    width: 80px;
}

.bulk-input[type='date'] {
    width: 140px;
}

/* Bulk Panel Title */
.bulk-panel-title {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: var(--text-primary, #e2e8f0);
}

/* Select All positioned at the end */
.select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary, #e2e8f0);
    white-space: nowrap;
}

.select-all-label input[type='checkbox'] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
}


.bulk-select {
    width: 100px;
}

/* bulk-select option visibility */
.bulk-select option {
    background-color: #2d2d2d;
    color: #ffffff;
}

[data-theme="light"] .bulk-select option {
    background-color: #ffffff;
    color: #000000;
}

[data-theme="midnight"] .bulk-select option {
    background-color: #1a1a1a;
    color: #ffffff;
}

[data-theme="sunset"] .bulk-select option {
    background-color: #2d3436;
    color: #ffffff;
}

/* Bulk Panel Header - Title and Select All */
.bulk-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.bulk-panel-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary, #e2e8f0);
}

/* Select All Label in Header */
.select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary, #e2e8f0);
    white-space: nowrap;
}

.select-all-label input[type='checkbox'] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
}

/* Bulk Edit Fields Row - Compact */
.bulk-edit-fields {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Bulk Edit Buttons Row */
.bulk-edit-buttons {
    display: flex;
    gap: 12px;
}

/* Mobile Responsive Styles - Card Layout */
@media (max-width: 768px) {
    .controls {
        padding: 8px;
        margin-bottom: 10px;
    }

    .sort-controls {
        gap: 5px;
        padding: 2px;
    }

    .sort-controls label {
        font-size: 0.85rem;
        margin-left: 0 !important;
    }

    .sort-select {
        padding: 5px 8px;
        font-size: 0.85rem;
        min-width: auto;
    }

    /* Reverse checkbox styling for mobile */
    .sort-controls label input[type="checkbox"] {
        margin-right: 2px;
    }

    /* Reduce header size on mobile */
    header h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    /* Remove table container scroll */
    .table-container {
        overflow-x: visible;
    }

    /* Hide table header on mobile */
    table thead {
        display: none;
    }

    /* Convert table to card layout */
    table,
    tbody {
        display: block;
        width: 100%;
    }

    tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        margin-bottom: 12px;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 10px;
        padding: 10px;
        padding-right: 80px;
        padding-left: 10px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        position: relative;
    }

    tbody tr:hover {
        transform: none;
        background: var(--glass-hover);
    }

    /* All cells reset */
    td {
        padding: 0;
        border: none;
        white-space: normal;
    }

    /* Hide index number */
    td:nth-child(1) {
        display: none;
    }

    /* Type badge - inline */
    td:nth-child(2) {
        order: 1;
        margin-right: 6px;
    }

    /* Resolution badge - inline next to Type */
    td:nth-child(3) {
        order: 2;
        margin-right: auto;
    }

    /* Title - full width, prominent */
    td:nth-child(4) {
        order: 3;
        width: 100%;
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--text-main);
        margin-top: 4px;
        margin-bottom: 2px;
        line-height: 1.3;
    }

    /* Size - small text */
    td:nth-child(5) {
        order: 4;
        font-size: 0.75rem;
        color: var(--text-subtitle);
        margin-right: 10px;
    }

    /* Date - small text */
    td:nth-child(6) {
        order: 5;
        font-size: 0.75rem;
        color: var(--text-subtitle);
    }

    /* Magnet button - absolute top right */
    td:nth-child(7) {
        position: absolute;
        top: 10px;
        right: 10px;
        order: 6;
    }

    /* Remove ALL ::before labels */
    td:nth-child(2)::before,
    td:nth-child(3)::before,
    td:nth-child(4)::before,
    td:nth-child(5)::before,
    td:nth-child(6)::before,
    td:nth-child(7)::before {
        content: none !important;
        display: none !important;
    }

    /* Adjust button size */
    td:nth-child(7) .copy-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .export-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        width: 100%;
    }

    /* Adjust results header for mobile */
    .results-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .results-header h2 {
        font-size: 1.2rem;
        text-align: center;
    }

    /* Checkbox column for bulk edit mode */
    .checkbox-col {
        order: -1;
        width: auto !important;
        text-align: left !important;
        padding: 0 !important;
        margin: 0 !important;
        margin-right: 6px !important;
        border: none !important;
        display: none !important;
    }

    tbody.bulk-edit-active .checkbox-col {
        display: block !important;
    }

    .checkbox-col input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        margin: 0;
    }

    .checkbox-col::before {
        content: none !important;
    }
}

/* Bulk Action Buttons */
.bulk-update-btn,
.bulk-delete-btn,
.bulk-recheck-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bulk-update-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.bulk-update-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.bulk-delete-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.bulk-delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.bulk-recheck-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    margin-left: 0 !important;
}

.bulk-recheck-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(56, 239, 125, 0.4);
}

/* ==========================================
   마스터 모드 모달 스타일
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.3s ease-in;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.95) 0%, rgba(20, 20, 35, 0.98) 100%);
    backdrop-filter: blur(30px);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 24px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 100px rgba(102, 126, 234, 0.2);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

/* 모달 배경 글로우 효과 */
.modal-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.modal-content h2 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.modal-content .form-group {
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.modal-content .form-group label {
    display: block;
    color: var(--text-subtitle);
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-content .form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(102, 126, 234, 0.3);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    /* Ensure sufficient height for text */
    min-height: 38px;
    /* Fixed minimum height to prevent squashing */
    outline: none;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) inset;
}

.modal-content .form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2) inset,
        0 0 0 4px rgba(102, 126, 234, 0.15),
        0 0 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.modal-content .form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

.modal-actions .btn {
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.modal-actions .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.modal-actions .btn:hover::before {
    width: 300px;
    height: 300px;
}

.modal-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    position: relative;
}

.modal-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.modal-actions .btn-primary {
    background: var(--primary-gradient);
    color: white;
    position: relative;
    box-shadow: 0 8px 20px var(--primary-shadow);
}

.modal-actions .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow:
        0 12px 30px var(--primary-shadow),
        0 0 40px rgba(102, 126, 234, 0.4);
}

.modal-actions .btn-primary:active {
    transform: translateY(-1px);
}

/* 애니메이션 */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-fade-out {
    opacity: 0 !important;
    transform: translateY(20px) scale(0.95) !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: none !important;
}

/* 라이트 테마 조정 */
[data-theme="light"] .modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 247, 250, 0.98) 100%);
    border-color: rgba(9, 132, 227, 0.3);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

[data-theme="light"] .modal-content::before {
    background: radial-gradient(circle, rgba(9, 132, 227, 0.08) 0%, transparent 70%);
}

[data-theme="light"] .modal-content .form-control {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) inset;
}

[data-theme="light"] .modal-content .form-control:focus {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--accent-color);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.05) inset,
        0 0 0 4px rgba(9, 132, 227, 0.1),
        0 0 20px rgba(9, 132, 227, 0.2);
}

/* Deep Space Theme */
[data-theme="space"] {
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --bg-size: 100% 100%;
    --bg-animation: none;
}

/* Electric Orange Theme */
[data-theme="orange"] {
    --bg-gradient: linear-gradient(135deg, #ff6b35, #f7931e, #ff9068);
    --bg-size: 100% 100%;
    --bg-animation: none;
}

/* ========================================
   GRID VIEW LAYOUT FIX
   ======================================== */

/* Grid View Container */
body.view-grid-active .container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 4px !important;
    /* Minimal padding */
}

body.view-grid-active .table-responsive {
    overflow-x: visible !important;
}

/* Grid View Table Structure */
body.view-grid-active #torrentTable {
    display: block !important;
    width: 100% !important;
}

body.view-grid-active #torrentTable thead {
    display: none !important;
}

body.view-grid-active #torrentTable tbody {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)) !important;
    /* 400px width */
    gap: 10px !important;
    /* Reduced gap */
    padding: 10px !important;
    width: 100% !important;
}

/* Grid View Individual Items */
body.view-grid-active #torrentTable tbody tr {
    display: flex !important;
    flex-direction: column !important;
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(var(--blur-amount)) !important;
    height: auto !important;
    min-height: 350px !important;
}

body.view-grid-active #torrentTable tbody tr:hover {
    background: var(--glass-hover) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
}

/* Grid View Cells */
body.view-grid-active #torrentTable tbody tr td {
    display: block !important;
    border: none !important;
    padding: 4px 0 !important;
    text-align: left !important;
}

/* Hide row number in grid view */
body.view-grid-active #torrentTable tbody tr td:first-child {
    display: none !important;
}

/* Thumbnail in grid view */
body.view-grid-active #torrentTable tbody tr td.thumbnail-cell {
    width: 100% !important;
    height: 200px !important;
    margin-bottom: 12px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    background: rgba(0, 0, 0, 0.2) !important;
}

body.view-grid-active #torrentTable tbody tr td.thumbnail-cell img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Title in grid view */
body.view-grid-active #torrentTable tbody tr td.title-cell {
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
    color: var(--text-main) !important;
}

/* Badges in grid view */
body.view-grid-active .type-badge,
body.view-grid-active .res-badge {
    display: inline-block !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    margin-right: 6px !important;
    margin-bottom: 6px !important;
}

/* Size and Date in grid view */
body.view-grid-active #torrentTable tbody tr td.size-cell,
body.view-grid-active #torrentTable tbody tr td.date-cell {
    font-size: 12px !important;
    color: var(--text-subtitle) !important;
}

/* Action buttons in grid view */
body.view-grid-active #torrentTable tbody tr td.actions-cell {
    margin-top: auto !important;
    padding-top: 12px !important;
}

body.view-grid-active #torrentTable tbody tr td.actions-cell button {
    width: 100% !important;
    margin-bottom: 6px !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    body.view-grid-active #torrentTable tbody {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    body.view-grid-active #torrentTable tbody tr {
        min-height: 300px !important;
    }

    body.view-grid-active #torrentTable tbody tr td.thumbnail-cell {
        height: 150px !important;
    }
}