:root {
    --primary-color: #002b49;
    --accent-color: #d9534f;
    --success-color: #28a745;
    --bg-color: #f0f2f5;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 15px;
    color: #333;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.brand-link:hover {
    opacity: 0.8;
}

.brand-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.brand-logo {
    height: 36px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ─── Intranet Service Navigation ─── */
.intranet-nav {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.intranet-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: #f1f3f5;
    color: #495057;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid #dee2e6;
}

.intranet-nav-link:hover {
    background: #e66c37;
    color: white;
    border-color: #e66c37;
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .intranet-nav {
        display: none;
    }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.clear-search-btn {
    padding: 12px;
    margin-left: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
}

h1 {
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    margin: 0 0 25px 0;
}

h1 a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

h1 img {
    height: 45px;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: #666;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb span {
    margin: 0 8px;
    color: #ccc;
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 16px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.upload-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 15px;
    width: 100%;
}

@media (min-width: 992px) {
    .toolbar-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

.tool-form {
    display: flex;
    align-items: center;
    width: 100%;
}

.input-group {
    display: flex;
    width: 100%;
    background: white;
    padding: 5px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    transition: border-color 0.2s;
}

.input-group {
    display: flex;
    gap: 5px;
}

input[type="text"],
input[type="file"] {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    flex-grow: 1;
    font-size: 14px;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #003a63;
}

.btn-accent {
    background: var(--accent-color);
    color: white;
}

.btn-accent:hover {
    background: #c9302c;
}

/* Unified Responsive List (Grid System) */
.file-list {
    width: 100%;
    margin-top: 20px;
}

.list-header {
    display: grid;
    grid-template-columns: 50px 1fr 200px;
    padding: 15px;
    font-weight: 700;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

.list-item {
    display: grid;
    grid-template-columns: 50px 1fr 200px;
    padding: 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
    margin-bottom: 12px;
    background: white;
    transition: background 0.2s;
}

.list-item:hover {
    background-color: #fbfbfb;
}

/* Desktop view adjustments */
@media (min-width: 768px) {
    .list-header {
        display: grid;
    }

    .list-item {
        grid-template-columns: 50px 1fr 200px;
        align-items: center;
        border: none;
        border-bottom: 1px solid #eee;
        border-radius: 0;
        margin-bottom: 0;
        padding: 12px 15px;
    }
}

.item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.item-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.item-name {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.action-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.delete-action-btn {
    background: #e03131;
}

.delete-action-btn:hover {
    background: #c22525;
}

.action-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    color: #1c7ed6;
    transition: transform 0.2s;
}

.action-link-btn:hover {
    transform: scale(1.2);
}

.copy-link {
    font-size: 0.85rem;
    color: var(--success-color);
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.delete-btn {
    color: #bdc3c7;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 5px;
    transition: color 0.2s;
}

.delete-btn:hover {
    color: var(--accent-color);
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.flash-success {
    background: #e7f3ef;
    color: #1e7e34;
    border: 1px solid #d4edda;
}

.flash-error {
    background: #fdf2f2;
    color: #c81e1e;
    border: 1px solid #f8d7da;
}

.form-check-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.bulk-actions {
    position: sticky;
    bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    justify-content: center;
    z-index: 1000;
    width: fit-content;
    margin: 0 auto;
}

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* Drag and Drop Styles */
.list-item.dragging {
    opacity: 0.5;
    background-color: #f8f9fa;
}

.list-item.drag-over {
    border: 2px dashed var(--primary-color);
    background-color: #eaf0f6;
}