/**
 * Copyright Manager - Public Styles
 */

/* 기본 변??*/
:root {
    --cm-primary: #2c5aa0;
    --cm-primary-dark: #1e3d6f;
    --cm-success: #28a745;
    --cm-warning: #ffc107;
    --cm-danger: #dc3545;
    --cm-gray: #6c757d;
    --cm-light: #f8f9fa;
    --cm-border: #dee2e6;
    --cm-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --cm-radius: 8px;
}

/* 공통 ?��???*/
.cm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--cm-radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cm-button-primary {
    background: var(--cm-primary);
    color: #fff;
}

.cm-button-primary:hover {
    background: var(--cm-primary-dark);
    color: #fff;
}

.cm-button-large {
    padding: 14px 30px;
    font-size: 16px;
}

.cm-input,
.cm-select,
.cm-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.cm-input:focus,
.cm-select:focus,
.cm-textarea:focus {
    outline: none;
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

/* ?�림 */
.cm-notice {
    padding: 15px 20px;
    border-radius: var(--cm-radius);
    margin-bottom: 20px;
}

.cm-notice-info {
    background: #e7f3ff;
    border-left: 4px solid var(--cm-primary);
    color: #0c5460;
}

.cm-notice-success {
    background: #d4edda;
    border-left: 4px solid var(--cm-success);
    color: #155724;
}

.cm-notice-warning {
    background: #fff3cd;
    border-left: 4px solid var(--cm-warning);
    color: #856404;
}

.cm-notice-error {
    background: #f8d7da;
    border-left: 4px solid var(--cm-danger);
    color: #721c24;
}

/* ==================== 검???�이지 ==================== */
.cm-search-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.cm-search-title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

.cm-search-description {
    text-align: center;
    color: var(--cm-gray);
    margin-bottom: 30px;
}

.cm-search-form {
    background: var(--cm-light);
    padding: 25px;
    border-radius: var(--cm-radius);
    margin-bottom: 30px;
}

.cm-search-fields {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.cm-search-field {
    flex: 1;
    min-width: 200px;
}

.cm-search-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.cm-search-button-wrap {
    flex: 0 0 auto;
}

.cm-search-icon {
    margin-right: 5px;
}

.cm-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cm-border);
}

.cm-results-count {
    font-size: 16px;
    color: var(--cm-gray);
}

.cm-search-close {
    background: var(--cm-gray);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.cm-search-close:hover {
    background: var(--cm-danger);
    transform: scale(1.1);
}

.cm-search-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.cm-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.cm-no-results {
    text-align: center;
    padding: 40px;
    color: var(--cm-gray);
}

.cm-loading {
    text-align: center;
    padding: 40px;
    color: var(--cm-gray);
}

/* ==================== 매니?� 카드 ==================== */
.cm-manager-card {
    background: linear-gradient(135deg, #1e3d6f 0%, #2c5aa0 100%);
    border-radius: 12px;
    padding: 25px;
    color: #fff;
    box-shadow: var(--cm-shadow);
    max-width: 400px;
    margin: 0 auto;
}

.cm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cm-card-badge {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}

.cm-card-verified {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 10px;
    border-radius: 20px;
}

.cm-verified-icon {
    color: #4ade80;
}

.cm-card-body {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.cm-card-photo {
    width: 100px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.cm-card-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cm-photo-icon {
    font-size: 48px;
    opacity: 0.5;
}

.cm-card-info {
    flex: 1;
}

.cm-card-row {
    margin-bottom: 12px;
}

.cm-card-label {
    display: block;
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 3px;
}

.cm-card-value {
    font-size: 16px;
    font-weight: 600;
}

.cm-card-number .cm-card-value {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.cm-card-mission {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.cm-mission-label {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 8px;
}

.cm-mission-content {
    font-size: 14px;
    line-height: 1.6;
    font-style: italic;
}

.cm-card-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.cm-card-seal {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    opacity: 0.8;
}

.cm-seal-icon {
    color: #fbbf24;
}

/* ?�짜 ?�보 ?��???*/
.cm-card-approved .cm-card-value,
.cm-card-expires .cm-card-value,
.cm-card-renewed .cm-card-value {
    font-size: 14px;
}

.cm-card-value.cm-expired {
    color: #fca5a5;
}

.cm-expired-badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 600;
    vertical-align: middle;
}

/* 결과 카드 (검??결과?? */
.cm-result-card {
    background: #fff;
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cm-result-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--cm-shadow);
}

.cm-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cm-result-badge {
    background: var(--cm-primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.cm-result-verified {
    color: var(--cm-success);
    font-size: 13px;
}

.cm-result-body {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.cm-result-photo {
    width: 60px;
    height: 70px;
    background: var(--cm-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cm-result-photo .cm-photo-icon {
    font-size: 30px;
    color: var(--cm-gray);
}

.cm-result-info {
    flex: 1;
}

.cm-result-number {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--cm-gray);
    margin-bottom: 5px;
}

.cm-result-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.cm-result-region {
    font-size: 14px;
    color: var(--cm-gray);
}

.cm-result-mission {
    font-size: 14px;
    color: #555;
    font-style: italic;
    line-height: 1.5;
    padding-top: 15px;
    border-top: 1px solid var(--cm-border);
}

/* ==================== ?�청 ??==================== */
.cm-apply-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.cm-apply-title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 10px;
}

.cm-apply-description {
    text-align: center;
    color: var(--cm-gray);
    margin-bottom: 30px;
}

.cm-apply-form {
    background: #fff;
    padding: 30px;
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
}

.cm-form-row {
    margin-bottom: 25px;
}

.cm-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.cm-required {
    color: var(--cm-danger);
}

.cm-field-description {
    margin-top: 8px;
    font-size: 13px;
    color: var(--cm-gray);
}

.cm-form-submit {
    text-align: center;
    padding-top: 10px;
}

.cm-apply-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: var(--cm-radius);
    text-align: center;
}

.cm-apply-message.cm-success {
    background: #d4edda;
    color: #155724;
}

.cm-apply-message.cm-error {
    background: #f8d7da;
    color: #721c24;
}

/* ==================== ???�태 ==================== */
.cm-my-status {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.cm-my-status h3 {
    margin-bottom: 20px;
}

.cm-status-table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    box-shadow: var(--cm-shadow);
    border-radius: var(--cm-radius);
    overflow: hidden;
}

.cm-status-table th,
.cm-status-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--cm-border);
}

.cm-status-table th {
    background: var(--cm-light);
    width: 30%;
    font-weight: 600;
}

.cm-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.cm-badge-pending {
    background: #fff3cd;
    color: #856404;
}

.cm-badge-approved {
    background: #d4edda;
    color: #155724;
}

.cm-badge-rejected {
    background: #f8d7da;
    color: #721c24;
}

.cm-badge-expired {
    background: #f8d7da;
    color: #721c24;
}

.cm-my-card {
    margin-top: 30px;
}

.cm-my-card h4 {
    margin-bottom: 15px;
}

/* ==================== 검??결과 카드 ?�릭 ==================== */
.cm-result-card {
    cursor: pointer;
}

.cm-result-card .cm-result-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* ==================== ?�업 모달 ==================== */
.cm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.cm-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cm-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    position: relative;
    margin: 40px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: cmModalFadeIn 0.3s ease;
}

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

.cm-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.cm-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cm-modal-content {
    padding: 0;
}

/* 모달 카드 ?��???*/
.cm-modal-card {
    background: linear-gradient(135deg, #1e3d6f 0%, #2c5aa0 100%);
    border-radius: 12px 12px 0 0;
    padding: 25px;
    color: #fff;
}

.cm-modal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cm-modal-badge {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}

.cm-modal-verified {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 10px;
    border-radius: 20px;
}

.cm-modal-card-body {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.cm-modal-photo {
    width: 120px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cm-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cm-modal-photo .cm-photo-icon {
    font-size: 60px;
    opacity: 0.5;
}

.cm-modal-info {
    flex: 1;
}

.cm-modal-row {
    margin-bottom: 10px;
}

.cm-modal-label {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cm-modal-value {
    font-size: 15px;
    font-weight: 600;
}

.cm-modal-name {
    font-size: 20px;
}

#cm-modal-number {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.cm-modal-mission {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.cm-modal-mission-label {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.cm-modal-mission-content {
    font-size: 14px;
    line-height: 1.6;
    font-style: italic;
}

.cm-modal-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.cm-modal-seal {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    opacity: 0.8;
}

/* ?�격�??��?지 ?�션 */
.cm-modal-certificate {
    padding: 20px 25px 25px;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

.cm-modal-certificate h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.cm-modal-certificate-image {
    background: #f5f5f5;
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cm-modal-certificate-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.cm-modal-certificate-image .cm-no-image {
    color: #999;
    font-size: 14px;
}

/* 만료 ?��???*/
.cm-modal-expired {
    color: #fca5a5;
}

.cm-modal-expired-badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 600;
}

/* 모달 로딩 */
.cm-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #666;
}

/* ==================== 반응??==================== */
@media screen and (max-width: 768px) {
    .cm-search-fields {
        flex-direction: column;
    }

    .cm-search-field {
        min-width: 100%;
    }

    .cm-card-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cm-result-body {
        flex-direction: column;
        text-align: center;
    }

    .cm-result-photo {
        margin: 0 auto;
    }

    .cm-results-grid {
        grid-template-columns: 1fr;
    }

    /* 모달 반응??*/
    .cm-modal {
        margin: 20px auto;
    }

    .cm-modal-card-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cm-modal-photo {
        width: 100px;
        height: 130px;
    }
}
