/**
 * WIABooks Frontend Styles
 *
 * @package WIABooks_Signup_System
 * @version 1.0.0
 */

/* General Container */
.wiabooks-book-info-page,
.wiabooks-author-dashboard {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.wiabooks-book-info-page .container {
    width: 100%;
}

/* Page Header */
.page-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.page-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

/* Form Wrapper */
.wiabooks-form-wrapper {
    max-width: 1200px !important;
    width: 95% !important;
    margin: 0 auto !important;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Form Styles */
.wiabooks-form .form-group {
    margin-bottom: 25px;
}

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

.wiabooks-form label.required::after {
    content: " *";
    color: #e74c3c;
}

.wiabooks-form .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.wiabooks-form .form-control:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.wiabooks-form textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.wiabooks-form .form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Form Notice */
.form-notice {
    background: #e7f3ff;
    border-left: 4px solid #2271b1;
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 4px;
}

.form-notice p {
    margin: 0 0 10px 0;
    font-weight: 600;
}

.form-notice ul {
    margin: 0;
    padding-left: 20px;
}

.form-notice li {
    margin-bottom: 5px;
    color: #555;
}

/* Form Actions */
.form-actions {
    margin-top: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: #2271b1;
    color: #fff;
}

.btn-primary:hover {
    background: #135e96;
}

.btn-secondary {
    background: #666;
    color: #fff;
}

.btn-secondary:hover {
    background: #555;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Form Messages */
.form-message {
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 4px;
    font-size: 14px;
}

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

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

/* Dashboard Header */
.dashboard-header {
    margin-bottom: 40px;
    text-align: center;
}

.dashboard-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
    color: #333;
}

.dashboard-subtitle {
    font-size: 16px;
    color: #666;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.dashboard-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-card h2 {
    font-size: 20px;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    color: #333;
}

/* Book Info Card */
.book-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.book-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.book-detail-item strong {
    color: #666;
    font-size: 14px;
}

.book-detail-item span,
.book-detail-item a {
    color: #333;
    font-weight: 500;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #2271b1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Credit Card */
.credit-balance {
    text-align: center;
}

.credit-amount {
    font-size: 48px;
    font-weight: bold;
    color: #0a7b0a;
    margin-bottom: 10px;
}

.credit-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.credit-note {
    padding: 15px;
    background: #fff9e6;
    border-left: 4px solid #ffb700;
    border-radius: 4px;
    margin-top: 15px;
}

.credit-note small {
    font-size: 12px;
    color: #666;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Dashboard Section */
.dashboard-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.dashboard-section h2 {
    font-size: 24px;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* Posts Table */
.posts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.posts-table th,
.posts-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.posts-table th {
    background: #f9f9f9;
    font-weight: 600;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
}

.posts-table tr:hover {
    background: #f9f9f9;
}

.post-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.status-publish {
    background: #d4edda;
    color: #155724;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-pending {
    background: #d1ecf1;
    color: #0c5460;
}

.status-private {
    background: #f8d7da;
    color: #721c24;
}

.no-posts {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-posts a {
    color: #2271b1;
    font-weight: 600;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #4a9fd8);
    transition: width 0.5s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.progress-message {
    text-align: center;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Signup Container */
.wiabooks-signup-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.wiabooks-signup-container h2 {
    margin-bottom: 15px;
}

.wiabooks-signup-container p {
    color: #666;
    margin-bottom: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

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

    .wiabooks-form-wrapper {
        padding: 30px 20px;
    }

    .dashboard-section {
        padding: 20px;
    }

    .posts-table {
        font-size: 14px;
    }

    .posts-table th,
    .posts-table td {
        padding: 8px 10px;
    }
}

/* 카테고리 그리드 */
.category-selection {
    margin: 30px 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.category-card {
    display: block;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    transition: all 0.3s ease;
    background: #fff;
}

.category-card:hover {
    border-color: #3B82F6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.category-card input[type="checkbox"] {
    display: none;
}

.category-card input[type="checkbox"]:checked ~ .category-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.category-card input[type="checkbox"]:checked ~ .category-content .category-icon {
    transform: scale(1.2);
}

.category-card input[type="checkbox"]:checked ~ .category-content .category-desc {
    color: rgba(255, 255, 255, 0.9);
}

.category-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 10px;
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.category-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
    line-height: 1.3;
}

.category-desc {
    font-size: 11px;
    color: #6b7280;
    transition: color 0.3s ease;
}

#category-count {
    display: block;
    margin-top: 10px;
    font-weight: 600;
    color: #3B82F6;
    font-size: 14px;
}

.form-description {
    color: #6b7280;
    font-size: 14px;
    margin: 5px 0 15px 0;
}

/* 폼 섹션 구분 */
.form-section {
    margin: 40px 0;
    padding: 30px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1f2937;
}

.section-description {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
}

/* 주요 카테고리 선택 (라디오 버튼) */
.primary-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.primary-category-card {
    display: block;
    cursor: pointer;
    border: 3px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    transition: all 0.3s ease;
    background: #fff;
}

.primary-category-card:hover {
    border-color: #10B981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transform: scale(1.05);
}

.primary-category-card input[type="radio"] {
    display: none;
}

.primary-category-card input[type="radio"]:checked ~ .primary-category-content {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.primary-category-card input[type="radio"]:checked ~ .primary-category-content::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    font-weight: bold;
}

.primary-category-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 10px;
}

.primary-category-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.primary-category-name {
    font-weight: 700;
    font-size: 15px;
}

/* 제출 버튼 비활성화 */
.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 페이지 전체 너비 확보 */
.wiabooks-book-info-page {
    width: 100%;
    max-width: 100%;
    padding: 40px 20px;
}

.wiabooks-book-info-page .container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* GeneratePress 테마 충돌 방지 */
.wiabooks-book-info-page .site-content {
    width: 100% !important;
    max-width: 100% !important;
}

.wiabooks-book-info-page .content-area {
    width: 100% !important;
    max-width: 100% !important;
}

/* ==========================================
   WIA Books - Premium EDD Download Page
   ========================================== */

/* 다운로드 페이지 전체 */
body.single-download .site-main#main {
    max-width: 1000px !important;
    margin: 60px auto !important;
    padding: 0 20px !important;
}

/* 배경 */
body.single-download article.edd-download .inside-article {
    background: #f9fafb !important;
    padding: 40px !important;
    border-radius: 32px !important;
}

/* 헤더 - 그라데이션 */
body.single-download article.edd-download .entry-header {
    text-align: center !important;
    margin-bottom: 48px !important;
    padding: 40px 20px !important;
    background: linear-gradient(135deg, #4A5FC1 0%, #667eea 100%) !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 40px rgba(74, 95, 193, 0.3) !important;
    position: relative !important;
    overflow: hidden !important;
}

body.single-download article.edd-download .entry-header::before {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    right: -10% !important;
    width: 400px !important;
    height: 400px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 50% !important;
    pointer-events: none !important;
}

body.single-download article.edd-download .entry-title {
    font-size: 48px !important;
    font-weight: 800 !important;
    color: white !important;
    margin: 0 !important;
    position: relative !important;
    z-index: 1 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* 콘텐츠 카드 */
body.single-download article.edd-download .entry-content {
    background: white !important;
    border-radius: 24px !important;
    padding: 48px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 40px !important;
}

body.single-download .entry-content h2 {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin-bottom: 16px !important;
    margin-top: 0 !important;
}

body.single-download .entry-content h3 {
    font-size: 24px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    margin-top: 40px !important;
    margin-bottom: 20px !important;
}

body.single-download .entry-content p {
    font-size: 18px !important;
    line-height: 1.8 !important;
    color: #374151 !important;
    margin-bottom: 20px !important;
}

/* 리스트 스타일 */
body.single-download .entry-content ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 24px 0 !important;
}

body.single-download .entry-content ul li {
    padding: 16px 24px !important;
    margin-bottom: 12px !important;
    background: linear-gradient(135deg, rgba(74, 95, 193, 0.05) 0%, rgba(102, 126, 234, 0.05) 100%) !important;
    border-left: 4px solid #4A5FC1 !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    transition: all 0.3s ease !important;
}

body.single-download .entry-content ul li:hover {
    background: linear-gradient(135deg, rgba(74, 95, 193, 0.1) 0%, rgba(102, 126, 234, 0.1) 100%) !important;
    transform: translateX(8px) !important;
    box-shadow: 0 4px 12px rgba(74, 95, 193, 0.15) !important;
}

body.single-download .entry-content ul li strong {
    color: #111827 !important;
    font-weight: 600 !important;
}

/* 코드 & 강조 */
body.single-download .entry-content code {
    background: #fef3c7 !important;
    color: #92400e !important;
    padding: 4px 12px !important;
    border-radius: 6px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

body.single-download .entry-content em {
    display: block !important;
    margin-top: 20px !important;
    padding: 16px 24px !important;
    background: #dbeafe !important;
    border-left: 4px solid #3b82f6 !important;
    border-radius: 8px !important;
    color: #1e40af !important;
    font-style: normal !important;
    font-size: 15px !important;
}

/* 구매 폼 */
body.single-download .edd_download_purchase_form {
    background: white !important;
    border-radius: 24px !important;
    padding: 48px !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
    margin-top: 40px !important;
}

body.single-download .edd_purchase_submit_wrapper {
    text-align: center !important;
}

/* 구매 버튼 */
body.single-download button.edd-add-to-cart.button,
body.single-download input.edd-add-to-cart.button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 20px 48px !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: white !important;
    background: linear-gradient(135deg, #4A5FC1 0%, #667eea 100%) !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(74, 95, 193, 0.4) !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    cursor: pointer !important;
}

body.single-download button.edd-add-to-cart.button:hover,
body.single-download input.edd-add-to-cart.button:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 32px rgba(74, 95, 193, 0.5) !important;
    background: linear-gradient(135deg, #3d4f9d 0%, #5a6fcf 100%) !important;
}

body.single-download button.edd-add-to-cart.button:active,
body.single-download input.edd-add-to-cart.button:active {
    transform: translateY(-2px) !important;
}

/* 체크아웃 버튼 */
body.single-download a.edd_go_to_checkout {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 18px 40px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: white !important;
    background: linear-gradient(135deg, #22c55e 0%, #34d399 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4) !important;
    transition: all 0.3s ease !important;
    margin-top: 20px !important;
    text-decoration: none !important;
}

body.single-download a.edd_go_to_checkout:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 28px rgba(34, 197, 94, 0.5) !important;
}

/* 반응형 */
@media (max-width: 768px) {
    body.single-download .site-main#main {
        margin: 30px auto !important;
    }
    
    body.single-download .entry-title {
        font-size: 32px !important;
    }
    
    body.single-download .entry-content {
        padding: 32px 24px !important;
    }
    
    body.single-download .edd_download_purchase_form {
        padding: 32px 24px !important;
    }
    
    body.single-download button.edd-add-to-cart.button {
        padding: 16px 32px !important;
        font-size: 18px !important;
    }
}

/* 이모지 */
body.single-download .entry-content img.emoji {
    height: 1.2em !important;
    width: 1.2em !important;
    margin: 0 0.05em 0 0.1em !important;
    vertical-align: -0.1em !important;
    display: inline !important;
}

/* 중복 버튼 숨기기 */
body.single-download input.edd-add-to-cart.edd-no-js {
    display: none !important;
}

/* 버튼 레이아웃 - 같은 선상 + 약간 띄우기 */
body.single-download .edd_purchase_submit_wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
}

/* 구매 버튼 - 마진 제거 */
body.single-download button.edd-add-to-cart.button,
body.single-download input.edd-add-to-cart.button {
    margin: 0 !important;
}

/* 체크아웃 버튼 - 마진 제거 */
body.single-download a.edd_go_to_checkout {
    margin: 0 !important;
}

/* 반응형 - 모바일에서는 세로 배치 */
@media (max-width: 600px) {
    body.single-download .edd_purchase_submit_wrapper {
        flex-direction: column !important;
        gap: 12px !important;
    }
}
