/**
 * 템플릿 기능 전용 스타일시트
 */

/* 템플릿 버튼 컨테이너 */
.template-buttons-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px dashed #dee2e6;
}

.template-buttons-container h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-buttons-container h3::before {
    content: '⭐';
    font-size: 18px;
}

/* 템플릿 버튼 그리드 */
#template-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

/* 템플릿 버튼 래퍼 */
.template-btn-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* 템플릿 버튼 */
.template-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    flex: 1;
    width: 100%;
}

.template-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.template-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.template-btn:hover::before {
    left: 100%;
}

.template-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.template-btn:active {
    transform: translateY(-2px);
}

.template-btn-name {
    font-weight: 500;
}

.template-btn .use-count {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    margin-top: 5px;
}

/* 템플릿 삭제 버튼 */
.template-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.template-btn-wrapper:hover .template-delete-btn {
    opacity: 1;
}

.template-delete-btn:hover {
    background: rgba(192, 57, 43, 1);
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.template-delete-btn:active {
    transform: scale(0.95);
}

/* 템플릿이 없을 때 */
.no-templates {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.no-templates i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 템플릿 관리 페이지 */
.template-list {
    background: white;
    border-radius: 8px;
}

.template-item {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.template-item:hover {
    background: #f8f9fa;
}

.template-item:last-child {
    border-bottom: none;
}

.template-info {
    flex: 1;
}

.template-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.template-meta {
    font-size: 12px;
    color: #7f8c8d;
}

.template-meta span {
    margin-right: 15px;
}

.template-actions {
    display: flex;
    gap: 8px;
}

/* 템플릿 생성/수정 폼 */
.template-form-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.template-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
    border: 1px solid #dee2e6;
}

.template-preview h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.template-preview-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.template-preview-item:last-child {
    border-bottom: none;
}

.template-preview-label {
    flex: 0 0 120px;
    font-weight: 500;
    color: #7f8c8d;
}

.template-preview-value {
    flex: 1;
    color: #2c3e50;
}

/* 템플릿 제한 안내 */
.template-limit-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 13px;
}

.template-limit-info strong {
    font-weight: 600;
}

/* 반응형 */
@media (max-width: 768px) {
    #template-buttons {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .template-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .template-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    #template-buttons {
        grid-template-columns: 1fr;
    }
}
