/* Portfolio 섹션 */
.portfolio-section {
    width: 100%;
    margin-top: 80px;
}

/* Selector */
.selector-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.selector {
    display: inline-flex;
    background: #373737;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.option {
    padding: 12px 32px;
    border-radius: 6px;
    color: white;
    font-size: 18px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    background: #4a4a4a;
}

.option.selected {
    background: #232323;
    font-weight: 700;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

/* Card */
.card {
    position: relative;
    background: #373737;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

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

.card-content {
    padding: 24px;
}

.card-title {
    color: white;
    font-size: 20px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
}

.card-description {
    color: #cccccc;
    font-size: 16px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 16px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 12px;
    background: #232323;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 500;
}

/* Hover Content */
.hover-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-radius: 16px;
}

.card:hover .hover-content {
    opacity: 1;
    visibility: visible;
}

.hover-title {
    color: white;
    font-size: 18px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    padding: 0 20px;
}

.hover-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.hover-button {
    padding: 12px 24px;
    background: white;
    color: #232323;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    text-align: center;
}

.hover-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    padding: 1%;
    width: 100%;
    height: 100vh;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

.modal-content {
    position: relative;
    z-index: 1001;
    width: 70%;
    height: auto;
    max-height: 90vh;
}

.modal-inline {
    width: 100%;
    height: 100%;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.modal-flex {
    flex: 1;
    height: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 24px;
    overflow: auto;
}

.modal-main-image {
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px 80px;
    background: #232323;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 40px;
}

.modal-main-image::-webkit-scrollbar {
    width: 8px;
}

.modal-main-image::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.modal-main-image::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

.modal-image-image {
    width: 600px;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.modal-main-text {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-title {
    align-self: stretch;
    text-align: center;
    color: white;
    font-size: 40px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 700;
    line-height: 60px;
    word-wrap: break-word;
}

.modal-button {
    align-self: stretch;
    justify-content: center;
    align-items: center;
    gap: 8px;
    display: flex;
    flex-wrap: wrap;
}

.modal-back {
    padding: 4px 8px;
    background: #373737;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-button2 {
    padding: 4px 8px;
    color: white;
    font-size: 16px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 700;
    line-height: 24px;
}

.modal-p {
    margin-top: 40px;
    align-self: stretch;
    text-align: center;
    color: white;
    font-size: 16px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 500;
    line-height: 24px;
    word-wrap: break-word;
}

.portfolio-text {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-inner-text {
    align-self: stretch;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
}

.modal-content-title {
    width: 104px;
    color: white;
    font-size: 20px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 700;
    line-height: 30px;
}

.modal-content-detail {
    text-align: center;
    color: white;
    font-size: 20px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 400;
    line-height: 30px;
}

.text-title {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.text-title-detail {
    align-self: stretch;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
}

.portfront {
    flex-wrap: wrap;
}

/* Accordion */
.upper-accordion {
    align-self: stretch;
    margin-top: 20px;
}

.accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-item {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

.accordion-header {
    padding: 16px 20px;
    background: #373737;
    color: white;
    font-size: 18px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.accordion-header:hover {
    background: white;
    color: #232323;
}

.accordion-content {
    display: none;
    padding: 20px;
    background: #232323;
    color: white;
    font-size: 16px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 400;
    line-height: 1.8;
}

.number-item{
    font-weight: bold;
    font-size: 1.3em;
}

/* 번호 목록 스타일 (1., 2. 등) */
.accordion-content .number-item {
    margin-bottom: 10px;
    text-indent: 0;
    padding-left: 30px;  /* 전체 텍스트 들여쓰기 */
    text-indent: -30px;  /* 번호만 왼쪽으로 */
}

/* 불릿 포인트 스타일 (• 등) */
.accordion-content .bullet-item {
    margin-left: 20px;
    text-indent: 0;
    margin-bottom: 5px;
}

.accordion-item.active .accordion-content {
    display: block;
}

/* Exit and GitHub Buttons */
.upper-exit {
    position: absolute;
    top: 24px;
    right: -46px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 3;
}

.exit-button {
    padding: 16px;
    background: white;
    border-radius: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.exit-button:hover {
    transform: scale(1.1);
}

.modal-git {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.modal-git a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.modal-git-content {
    text-align: center;
    color: white;
    font-size: 16px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 400;
    line-height: 24px;
}

/* ========================================
   반응형 미디어 쿼리 (간소화)
   ======================================== */

/* 모바일 (최대 768px) */
@media (max-width: 768px) {
    .portfolio-section {
        margin-top: 40px;
    }
    
    .selector-container {
        margin-bottom: 24px;
    }
    
    .option {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card-image {
        height: 200px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    .card-description {
        font-size: 14px;
    }
    
    .tag {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .hover-title {
        font-size: 16px;
    }
    
    .hover-button {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 140px;
    }
    
    /* 모달 */
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-inline {
        padding: 16px;
        gap: 12px;
    }
    
    .modal-main-image {
        padding: 20px;
        gap: 24px;
    }
    
    .modal-image-image {
        width: 100%;
        height: auto;
        min-height: 180px;
    }
    
    .modal-title {
        font-size: 24px;
        line-height: 36px;
    }
    
    .modal-button2 {
        font-size: 14px;
    }
    
    .modal-p {
        margin-top: 24px;
        font-size: 14px;
        line-height: 21px;
    }
    
    .modal-content-title {
        width: 90px;
        font-size: 16px;
        line-height: 24px;
    }
    
    .modal-content-detail {
        font-size: 16px;
        line-height: 24px;
    }
    
    .accordion-header {
        font-size: 16px;
        padding: 14px 16px;
    }
    
    .accordion-content {
        font-size: 14px;
        padding: 16px;
        line-height: 1.6;
    }
    
    .upper-exit {
        top: 12px;
        right: -40px;
        gap: 8px;
    }
    
    .exit-button {
        padding: 12px;
    }
    
    .modal-git-content {
        font-size: 14px;
    }
}

/* 태블릿 (769px ~ 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .portfolio-section {
        margin-top: 60px;
    }
    
    .selector-container {
        margin-bottom: 32px;
    }
    
    .option {
        padding: 11px 28px;
        font-size: 17px;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .card-image {
        height: 220px;
    }
    
    .card-content {
        padding: 22px;
    }
    
    .card-title {
        font-size: 19px;
    }
    
    .card-description {
        font-size: 15px;
    }
    
    .tag {
        font-size: 14px;
        padding: 6px 11px;
    }
    
    .hover-title {
        font-size: 17px;
    }
    
    .hover-button {
        padding: 11px 22px;
        font-size: 15px;
    }
    
    /* 모달 */
    .modal-content {
        width: 85%;
    }
    
    .modal-inline {
        padding: 20px;
    }
    
    .modal-main-image {
        padding: 30px 50px;
        gap: 32px;
    }
    
    .modal-image-image {
        width: 500px;
        height: 250px;
    }
    
    .modal-title {
        font-size: 32px;
        line-height: 48px;
    }
    
    .modal-button2 {
        font-size: 15px;
    }
    
    .modal-p {
        margin-top: 32px;
        font-size: 15px;
        line-height: 23px;
    }
    
    .modal-content-title {
        width: 100px;
        font-size: 18px;
        line-height: 27px;
    }
    
    .modal-content-detail {
        font-size: 17px;
        line-height: 27px;
    }
    
    .accordion-header {
        font-size: 17px;
        padding: 15px 18px;
    }
    
    .accordion-content {
        font-size: 15px;
        padding: 18px;
        line-height: 1.7;
    }
    
    .upper-exit {
        top: 20px;
        right: -44px;
    }
    
    .exit-button {
        padding: 14px;
    }
    
    .modal-git-content {
        font-size: 15px;
    }
}

/* 데스크톱 (1025px ~ 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    .portfolio-section {
        margin-top: 80px;
    }
    
    .selector-container {
        margin-bottom: 40px;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    
    .card-image {
        height: 250px;
    }
    
    /* 모달 */
    .modal-content {
        width: 70%;
    }
    
    .modal-inline {
        padding: 24px;
    }
    
    .modal-main-image {
        padding: 40px 80px;
        gap: 40px;
    }
    
    .modal-image-image {
        width: 600px;
        height: 300px;
    }
}

/* 대형 데스크톱 (1441px ~ 1920px) */
@media (min-width: 1441px) and (max-width: 1920px) {
    .portfolio-section {
        margin-top: 90px;
    }
    
    .selector-container {
        margin-bottom: 45px;
    }
    
    .option {
        padding: 13px 35px;
        font-size: 19px;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 35px;
    }
    
    .card-image {
        height: 265px;
    }
    
    .card-content {
        padding: 26px;
    }
    
    .card-title {
        font-size: 21px;
    }
    
    .card-description {
        font-size: 16.5px;
    }
    
    .tag {
        font-size: 14.5px;
        padding: 6.5px 13px;
    }
    
    .hover-title {
        font-size: 19px;
    }
    
    .hover-button {
        padding: 13px 26px;
        font-size: 16px;
        min-width: 170px;
    }
    
    /* 모달 */
    .modal-content {
        width: 68%;
    }
    
    .modal-inline {
        padding: 26px;
    }
    
    .modal-main-image {
        padding: 45px 90px;
        gap: 45px;
    }
    
    .modal-image-image {
        width: 650px;
        height: 325px;
    }
    
    .modal-title {
        font-size: 42px;
        line-height: 63px;
    }
    
    .modal-button2 {
        font-size: 16px;
    }
    
    .modal-p {
        margin-top: 42px;
        font-size: 16px;
        line-height: 25px;
    }
    
    .modal-content-title {
        width: 107px;
        font-size: 21px;
        line-height: 32px;
    }
    
    .modal-content-detail {
        font-size: 20px;
        line-height: 32px;
    }
    
    .accordion-header {
        font-size: 18px;
        padding: 16px 21px;
    }
    
    .accordion-content {
        font-size: 16px;
        padding: 21px;
        line-height: 1.75;
    }
    
    .upper-exit {
        top: 26px;
        right: -48px;
    }
    
    .exit-button {
        padding: 16px;
    }
    
    .modal-git-content {
        font-size: 16px;
    }
}

/* 초대형 데스크톱 (1921px 이상) */
@media (min-width: 1921px) {
    .portfolio-section {
        margin-top: 100px;
        max-width: 1800px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .selector-container {
        margin-bottom: 50px;
    }
    
    .option {
        padding: 15px 40px;
        font-size: 20px;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    
    .card-image {
        height: 280px;
    }
    
    .card-content {
        padding: 28px;
    }
    
    .card-title {
        font-size: 22px;
    }
    
    .card-description {
        font-size: 17px;
    }
    
    .tag {
        font-size: 15px;
        padding: 7px 14px;
    }
    
    .hover-title {
        font-size: 20px;
    }
    
    .hover-button {
        padding: 14px 28px;
        font-size: 17px;
        min-width: 180px;
    }
    
    /* 모달 */
    .modal-content {
        width: 65%;
    }
    
    .modal-inline {
        padding: 28px;
    }
    
    .modal-main-image {
        padding: 50px 100px;
        gap: 50px;
    }
    
    .modal-image-image {
        width: 700px;
        height: 350px;
    }
    
    .modal-title {
        font-size: 44px;
        line-height: 66px;
    }
    
    .modal-button2 {
        font-size: 17px;
    }
    
    .modal-p {
        margin-top: 44px;
        font-size: 17px;
        line-height: 26px;
    }
    
    .modal-content-title {
        width: 110px;
        font-size: 22px;
        line-height: 33px;
    }
    
    .modal-content-detail {
        font-size: 21px;
        line-height: 33px;
    }
    
    .accordion-header {
        font-size: 19px;
        padding: 17px 22px;
    }
    
    .accordion-content {
        font-size: 17px;
        padding: 22px;
        line-height: 1.8;
    }
    
    .upper-exit {
        top: 28px;
        right: -50px;
    }
    
    .exit-button {
        padding: 18px;
    }
    
    .modal-git-content {
        font-size: 17px;
    }
}

/* 초소형 모바일 (최대 480px) */
@media (max-width: 480px) {
    .portfolio-section {
        margin-top: 30px;
    }
    
    .selector-container {
        margin-bottom: 20px;
    }
    
    .option {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .portfolio-grid {
        gap: 16px;
    }
    
    .card-image {
        height: 180px;
    }
    
    .card-content {
        padding: 16px;
    }
    
    .card-title {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .card-description {
        font-size: 13px;
    }
    
    .tag {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .hover-title {
        font-size: 14px;
    }
    
    .hover-button {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 120px;
    }
    
    /* 모달 */
    .modal-content {
        width: 98%;
        max-height: 96vh;
    }
    
    .modal-inline {
        padding: 12px;
        gap: 8px;
    }
    
    .modal-main-image {
        padding: 16px;
        gap: 20px;
    }
    
    .modal-image-image {
        width: 100%;
        height: auto;
        min-height: 150px;
    }
    
    .modal-title {
        font-size: 20px;
        line-height: 30px;
    }
    
    .modal-button2 {
        font-size: 12px;
        padding: 3px 6px;
    }
    
    .modal-p {
        margin-top: 20px;
        font-size: 13px;
        line-height: 19px;
    }
    
    .modal-content-title {
        width: 80px;
        font-size: 14px;
        line-height: 21px;
    }
    
    .modal-content-detail {
        font-size: 13px;
        line-height: 21px;
    }
    
    .accordion-header {
        font-size: 14px;
        padding: 12px 14px;
    }
    
    .accordion-content {
        font-size: 13px;
        padding: 14px;
        line-height: 1.5;
    }
    
    .upper-exit {
        top: 8px;
        right: -35px;
        gap: 6px;
    }
    
    .exit-button {
        padding: 10px;
    }
    
    .modal-git-content {
        font-size: 13px;
    }
}

/* 세로 높이가 낮은 화면 (최대 600px) */
@media (max-height: 600px) {
    .portfolio-section {
        margin-top: 20px;
    }
    
    .selector-container {
        margin-bottom: 16px;
    }
    
    .portfolio-grid {
        gap: 16px;
    }
    
    .card-image {
        height: 160px;
    }
    
    .card-content {
        padding: 16px;
    }
    
    /* 모달 */
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-inline {
        padding: 12px;
    }
    
    .modal-main-image {
        padding: 16px 24px;
        gap: 20px;
    }
    
    .modal-image-image {
        width: 100%;
        max-width: 400px;
        height: auto;
        min-height: 120px;
    }
    
    .modal-title {
        font-size: 20px;
        line-height: 30px;
    }
    
    .modal-p {
        margin-top: 16px;
        font-size: 13px;
        line-height: 19px;
    }
    
    .accordion-header {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .accordion-content {
        font-size: 12px;
        padding: 12px;
        line-height: 1.4;
    }
    
    .upper-exit {
        top: 6px;
        right: -30px;
    }
    
    .exit-button {
        padding: 8px;
    }
}