/* Education Page Styles */

.education-container {
    display: flex;
    margin: 0 auto;
    padding: 40px 120px;
    gap: 40px;
}

/* Sidebar Styles */
.education-sidebar {
    width: 306px;
    flex-shrink: 0;
}

.sidebar-header {
    position: relative;
    margin-bottom: 5px;
}

.sidebar-title {
    box-sizing: border-box;
    height: 49px;
    margin: 0;
    display: flex;
    align-items: center;
    background: #F7F7F8;
    border: 1px solid #E9E9E9;
    position: relative;
}

.sidebar-title a {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    font-family: 'Pretendard', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 16px;
    line-height: 23px;
    letter-spacing: 0.48px;
    color: #323232;
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-title a:hover {
    color: #3270AA;
}

.sidebar-title a.active {
    color: #3270AA;
}

.sidebar-title a::after {
    content: '';
    position: absolute;
    right: 16px;
    width: 10px;
    height: 10px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}

.btn-add-category {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background-color: #3b5998;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    opacity: 0;
    z-index: 10;
}

.sidebar-header:hover .btn-add-category {
    opacity: 1;
}

.sidebar-header:hover .sidebar-title a::after {
    display: none;
}

.btn-add-category:hover {
    background-color: #2d4373;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    box-sizing: border-box;
    height: 49px;
    position: relative;
    display: flex;
    align-items: center;
    background: #F7F7F8;
    border: 1px solid #E9E9E9;
    border-bottom: none;
}

.category-item:last-child {
    border-bottom: 1px solid #E9E9E9;
}

.category-item a {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    font-family: 'Pretendard', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 16px;
    line-height: 23px;
    letter-spacing: 0.48px;
    color: #323232;
    text-decoration: none;
    transition: color 0.2s;
}

.category-item a:hover {
    color: #3270AA;
}

.category-item a.active {
    color: #3270AA;
}

.category-item a::after {
    content: '';
    position: absolute;
    right: 16px;
    width: 10px;
    height: 10px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}

.category-actions {
    display: flex;
    gap: 4px;
    padding: 0 8px;
    opacity: 0;
    transition: opacity 0.2s;
    position: absolute;
    right: 40px;
    z-index: 10;
}

.category-item:hover .category-actions {
    opacity: 1;
}

.category-item:hover a::after {
    display: none;
}

.btn-edit-category,
.btn-delete-category {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 4px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: background-color 0.2s, color 0.2s;
}

.btn-edit-category:hover {
    background-color: #e3f2fd;
    color: #1976d2;
}

.btn-delete-category:hover {
    background-color: #ffebee;
    color: #d32f2f;
}

/* Main Content Area */
.education-main {
    flex: 1;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #3b5998;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
}

.page-title {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #333;
}

.result-count {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.btn-create-education {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background-color: #3b5998;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-create-education:hover {
    background-color: #2d4373;
}

/* Education Grid - 3x3 Layout */
.education-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.education-card {
    position: relative;
    width: 417px;
    height: 324px;
    background: white;
    border-radius: 0;
    overflow: hidden;
}

.card-admin-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-card-edit,
.btn-card-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    text-decoration: none;
}

.btn-card-edit {
    color: #1976d2;
}

.btn-card-edit:hover {
    background-color: #e3f2fd;
    border-color: #1976d2;
}

.btn-card-delete {
    color: #d32f2f;
}

.btn-card-delete:hover {
    background-color: #ffebee;
    border-color: #d32f2f;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-image {
    position: relative;
    width: 417px;
    height: 258px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 21.9%, rgba(0, 0, 0, 0.5) 87.17%);
    pointer-events: none;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0e0e0;
    color: #999;
}

.card-content {
    padding: 21px 0 0 0;
}

.card-category {
    display: block;
    margin-bottom: 4px;
    font-family: 'Pretendard', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 17px;
    color: #323232;
}

.card-title {
    margin: 0;
    font-family: 'Pretendard', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    color: #272727;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-results p {
    margin: 0;
    font-size: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    background-color: white;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.page-link:hover {
    background-color: #f5f5f5;
    border-color: #3b5998;
    color: #3b5998;
}

.page-link.active {
    background-color: #3b5998;
    color: white;
    border-color: #3b5998;
    font-weight: bold;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .education-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.modal-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

.modal-content form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group .required {
    color: #d32f2f;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3b5998;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #666;
    font-size: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #3b5998;
    color: white;
}

.btn-primary:hover {
    background-color: #2d4373;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .education-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .education-container {
        flex-direction: column;
        gap: 20px;
    }

    .education-sidebar {
        width: 100%;
    }

    .education-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .sidebar-header {
        flex-direction: column;
        gap: 0;
    }

    .sidebar-title {
        border-radius: 4px 4px 0 0;
        width: 100%;
    }

    .btn-add-category {
        border-radius: 0 0 4px 4px;
        width: 100%;
    }
}
