/**
 * Trial Site Connector 스타일
 */

/* 기본 변수 */
:root {
    --tsc-primary: #0073aa;
    --tsc-success: #46b450;
    --tsc-danger: #dc3232;
    --tsc-warning: #ffb900;
    --tsc-gray: #666;
    --tsc-light: #f0f0f0;
    --tsc-radius: 6px;
}

/* 버튼 기본 스타일 */
.tsc-trial-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--tsc-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tsc-trial-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tsc-trial-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 버튼 스타일 변형 */
.tsc-style-default {
    background: var(--tsc-light);
    color: #333;
    border: 1px solid #ddd;
}

.tsc-style-primary {
    background: var(--tsc-primary);
    color: white;
}

.tsc-style-primary:hover {
    background: #005a87;
}

.tsc-style-success {
    background: var(--tsc-success);
    color: white;
}

.tsc-style-success:hover {
    background: #3a9a42;
}

/* 폼 스타일 */
.tsc-trial-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.tsc-inline-form {
    max-width: 500px;
}

.tsc-email-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: var(--tsc-radius);
    outline: none;
    transition: border-color 0.3s ease;
}

.tsc-email-input:focus {
    border-color: var(--tsc-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* 결과 메시지 */
.tsc-result {
    margin-top: 15px;
    padding: 15px 20px;
    border-radius: var(--tsc-radius);
    animation: tscFadeIn 0.3s ease;
}

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

.tsc-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.tsc-result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.tsc-result h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.tsc-result p {
    margin: 5px 0;
}

.tsc-result a {
    color: inherit;
    font-weight: 600;
}

.tsc-result .tsc-site-url {
    display: block;
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    word-break: break-all;
}

.tsc-result .tsc-credentials {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.tsc-result .tsc-credentials code {
    background: rgba(255, 255, 255, 0.5);
    padding: 2px 6px;
    border-radius: 3px;
}

.tsc-result .tsc-credentials code.tsc-copy {
    cursor: pointer;
    transition: background 0.2s ease;
}

.tsc-result .tsc-credentials code.tsc-copy:hover {
    background: rgba(255, 255, 255, 0.8);
}

.tsc-result .tsc-copy-hint {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 8px !important;
}

.tsc-result .tsc-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tsc-result .tsc-actions .button {
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

.tsc-result .tsc-actions .button-primary {
    background: #0073aa;
    color: white;
    border: none;
}

.tsc-result .tsc-actions .button-primary:hover {
    background: #005a87;
}

.tsc-result .tsc-actions .button:not(.button-primary) {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.tsc-result .tsc-actions .button:not(.button-primary):hover {
    background: #e0e0e0;
}

/* 팝업 스타일 */
.tsc-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tscFadeIn 0.3s ease;
}

.tsc-popup-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: tscSlideUp 0.3s ease;
}

@keyframes tscSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tsc-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 5px 10px;
    line-height: 1;
}

.tsc-popup-close:hover {
    color: #333;
}

.tsc-popup-content h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.tsc-popup-content p {
    margin: 0 0 20px 0;
    color: var(--tsc-gray);
}

.tsc-popup-content .tsc-trial-form {
    flex-direction: column;
}

.tsc-popup-content .tsc-email-input {
    width: 100%;
}

.tsc-popup-content .tsc-trial-button {
    width: 100%;
}

/* 내 사이트 목록 */
.tsc-my-sites {
    max-width: 600px;
}

.tsc-my-sites h3 {
    margin-bottom: 20px;
    color: #333;
}

.tsc-site-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: var(--tsc-radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tsc-site-info h4 {
    margin: 0 0 10px 0;
}

.tsc-site-info h4 a {
    color: var(--tsc-primary);
    text-decoration: none;
}

.tsc-site-info h4 a:hover {
    text-decoration: underline;
}

.tsc-site-status,
.tsc-site-expires {
    margin: 5px 0;
    color: var(--tsc-gray);
    font-size: 14px;
}

.tsc-status-assigned {
    color: var(--tsc-primary);
    font-weight: 600;
}

.tsc-status-subscribed {
    color: var(--tsc-success);
    font-weight: 600;
}

.tsc-status-expired {
    color: var(--tsc-danger);
    font-weight: 600;
}

.tsc-days-left {
    color: var(--tsc-warning);
    font-weight: 600;
}

.tsc-expired {
    color: var(--tsc-danger);
    font-weight: 600;
}

.tsc-site-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.tsc-site-credentials {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
}

.tsc-site-credentials code {
    background: var(--tsc-light);
    padding: 2px 6px;
    border-radius: 3px;
}

.tsc-no-site {
    color: var(--tsc-gray);
}

.tsc-start-trial {
    color: var(--tsc-primary);
}

.tsc-login-notice {
    color: var(--tsc-gray);
}

.tsc-login-notice a {
    color: var(--tsc-primary);
}

/* 로딩 스피너 */
.tsc-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: tscSpin 0.8s linear infinite;
}

@keyframes tscSpin {
    to {
        transform: rotate(360deg);
    }
}

/* 반응형 */
@media (max-width: 480px) {
    .tsc-trial-form {
        flex-direction: column;
    }

    .tsc-email-input {
        width: 100%;
    }

    .tsc-trial-button {
        width: 100%;
    }

    .tsc-popup-content {
        padding: 30px 20px;
    }

    .tsc-site-actions {
        flex-direction: column;
    }
}
