/**
 * Site Management System - フロントエンドCSS
 * 
 * @package SiteManagementSystem
 * @version 1.0.0
 */

/* ==========================================================================
   基本設定
   ========================================================================== */

h2 {
    font-size: 1.25rem;
}

body,
h3,
h4,
h5,
h6,
p,
li,
span,
div,
a,
label,
input,
textarea,
select,
button {
    font-size: var(--wp--preset--font-size--medium);
}

.sms-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.sms-section {
    margin: 40px 0;
}

.sms-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.sms-card-auth {
    text-align: center;
    padding: 40px 30px;
}

.sms-auth-wrapper {
    padding-top: 20px;
    padding-bottom: 40px;
}

.sms-card-auth .sms-card-header {
    margin-bottom: 30px;
}

.sms-auth-grid {
    display: grid;
    gap: 40px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: start;
    text-align: left;
}

.sms-auth-description {
    margin-bottom: 25px;
    color: #555555;
    line-height: 1.8;
}

.sms-auth-description p {
    margin-bottom: 16px;
}

.sms-auth-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sms-auth-benefits li {
    margin-bottom: 10px;
    color: #444444;
    position: relative;
    padding-left: 24px;
}

.sms-auth-benefits li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 0;
    color: #28a745;
    font-weight: bold;
}

.sms-auth-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.sms-auth-actions .sms-btn {
    min-width: 160px;
}

.sms-auth-login {
    background: #f9fbff;
    border: 1px solid #d6e4ff;
    border-radius: 8px;
    padding: 24px;
    text-align: left;
}

#sms-login-form label {
    font-weight: 600;
    color: #333333;
    display: block;
    margin-bottom: 6px;
}

#sms-login-form input[type="text"],
#sms-login-form input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccd6e0;
    border-radius: 4px;
    margin-bottom: 12px;
}

#sms-login-form input[type="submit"] {
    width: 100%;
    margin-top: 8px;
}

#sms-login-form p.forgetmenot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
}

#sms-login-form .forgetmenot input[type="checkbox"] {
    width: auto;
    margin: 0;
}

#sms-login-form .forgetmenot label {
    margin: 0;
    font-weight: 400;
}

.sms-auth-register {
    text-align: center;
    margin-top: 20px;
}

.sms-auth-register p {
    margin-bottom: 12px;
    color: #555555;
}

.sms-auth-note {
    font-size: 14px;
    color: #666666;
}

.sms-auth-note a {
    color: #0073aa;
    text-decoration: none;
}

.sms-auth-note a:hover {
    text-decoration: underline;
}

.sms-card-header {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.sms-card-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.sms-card-subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* ==========================================================================
   フォーム要素
   ========================================================================== */

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

.sms-form-group {
    margin-bottom: 25px;
}

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

.sms-form-required {
    color: #e74c3c;
    margin-left: 3px;
}

.sms-form-input,
.sms-form-select,
.sms-form-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff;
}

.sms-form-group input[type="text"],
.sms-form-group input[type="email"],
.sms-form-group input[type="password"],
.sms-form-group input[type="tel"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.sms-form-group input:focus {
    outline: none;
    border-color: #007cba;
}

.sms-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.sms-form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.required {
    color: #d63638;
}

.sms-form-input:focus,
.sms-form-select:focus,
.sms-form-textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.sms-form-input.error,
.sms-form-select.error,
.sms-form-textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.sms-form-textarea {
    resize: vertical;
    min-height: 120px;
}

.sms-form-help {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.sms-help-inline {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    font-weight: 400;
    color: #666;
}

.sms-price-settings__grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

#profit-margin {
    max-width: 180px;
}

.sms-radio-group--column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sms-form-error {
    margin-top: 6px;
    font-size: 12px;
    color: #e74c3c;
    display: none;
}

/* チェックボックス・ラジオボタン */
.sms-checkbox,
.sms-radio {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.sms-checkbox input[type="checkbox"],
.sms-radio input[type="radio"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
}

.sms-checkbox-label,
.sms-radio-label {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}

/* ==========================================================================
   ボタン
   ========================================================================== */

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

/* メッセージ */
.sms-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

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

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

/* 登録・ログインフォーム */
.sms-register-form-wrapper,
.sms-login-form-wrapper {
    max-width: 500px;
    margin: 50px auto;
}

.sms-register-form-wrapper h2,
.sms-login-form-wrapper h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.sms-form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.sms-form-footer p {
    margin: 10px 0;
}

.sms-form-footer a {
    color: #007cba;
    text-decoration: none;
}

.sms-form-footer a:hover {
    text-decoration: underline;
}

.sms-btn-primary {
    background-color: #0073aa;
    color: #ffffff;
}

.sms-btn-primary:hover {
    background-color: #005a87;
    color: #ffffff;
    transform: translateY(-1px);
}

.sms-btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

.sms-btn-secondary:hover {
    background-color: #565e64;
    color: #ffffff;
    transform: translateY(-1px);
}

.sms-btn-success {
    background-color: #28a745;
    color: #ffffff;
}

.sms-btn-success:hover {
    background-color: #218838;
    color: #ffffff;
    transform: translateY(-1px);
}

.sms-btn-danger {
    background-color: #dc3545;
    color: #ffffff;
}

.sms-btn-danger:hover {
    background-color: #c82333;
    color: #ffffff;
    transform: translateY(-1px);
}

.sms-btn-outline {
    background-color: transparent;
    border: 2px solid #0073aa;
    color: #0073aa;
}

.sms-btn-outline:hover {
    background-color: #0073aa;
    color: #ffffff;
}

.sms-btn-large {
    padding: 16px 32px;
    font-size: 16px;
    min-width: 160px;
}

.sms-btn-small {
    padding: 8px 16px;
    font-size: 12px;
    min-width: 80px;
}

.sms-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.sms-btn-loading {
    position: relative;
    color: transparent;
}

.sms-btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: sms-spin 1s linear infinite;
}

/* ==========================================================================
   アラート・通知
   ========================================================================== */

.sms-alert {
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.5;
}

.sms-alert-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.sms-alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.sms-alert-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.sms-alert-info {
    background-color: #cce7ff;
    border-color: #0073aa;
    color: #004085;
}

.sms-alert-dismissible {
    position: relative;
    padding-right: 50px;
}

.sms-alert-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.sms-alert-close:hover {
    opacity: 1;
}

/* ==========================================================================
   ダッシュボード
   ========================================================================== */

.sms-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.sms-dashboard-stat {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.sms-dashboard-stat:hover {
    transform: translateY(-5px);
}

.sms-dashboard-stat-number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
}

.sms-dashboard-stat-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sms-dashboard-recent {
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.sms-dashboard-recent-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.sms-dashboard-recent-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.sms-dashboard-recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sms-dashboard-recent-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sms-dashboard-recent-item:last-child {
    border-bottom: none;
}

.sms-dashboard-recent-content {
    flex: 1;
}

.sms-dashboard-recent-text {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.sms-dashboard-recent-date {
    font-size: 12px;
    color: #666;
}

/* ==========================================================================
   ステータスバッジ
   ========================================================================== */

.sms-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.sms-status-processing {
    background: #cce7ff;
    color: #004085;
}

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

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

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

.sms-status-inactive {
    background: #e2e3e5;
    color: #383d41;
}

/* ==========================================================================
   プログレスバー
   ========================================================================== */

.sms-progress {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.sms-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005a87);
    transition: width 0.6s ease;
    border-radius: 4px;
}

.sms-progress-large {
    height: 16px;
}

.sms-progress-large .sms-progress-bar {
    border-radius: 8px;
}

/* ==========================================================================
   テーブル
   ========================================================================== */

.sms-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.sms-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.sms-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
    font-size: 14px;
}

.sms-table tr:hover {
    background-color: #f8f9fa;
}

.sms-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   スクレイピングフォーム専用
   ========================================================================== */

.sms-scraping-sites {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.sms-site-logo {
    text-align: center;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.sms-site-logo.selected {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.2);
}

.sms-site-logo.selected .sms-site-name {
    color: #0073aa;
    font-weight: 600;
}

.sms-site-logo:hover {
    border-color: #0073aa;
}

.sms-site-logo img {
    max-width: 80px;
    max-height: 40px;
    margin-bottom: 10px;
}

.sms-site-name {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* 全選択/全解除ボタン */
.sms-site-controls {
    text-align: center;
    margin: 20px 0;
}

.sms-control-button {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 10px;
    border: 1px solid #0073aa;
    border-radius: 4px;
    background: white;
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sms-control-button:hover {
    background: #0073aa;
    color: white;
}

/* エラー表示 */
.sms-no-sites {
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 20px 0;
}

/* サイト選択状態のスタイル強化 */
.sms-site-logo.selected {
    border-color: #0073aa !important;
    background: #f0f8ff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.sms-site-logo.selected .sms-site-name {
    color: #0073aa;
    font-weight: 600;
}

/* 選択ボタンのスタイル改善 */
.sms-site-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.sms-site-controls .sms-control-button {
    padding: 8px 16px;
    font-size: 14px;
    min-width: 80px;
}

.sms-request-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
}

.sms-remove-item {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
}

.sms-add-item {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
}

/* ==========================================================================
   レスポンシブデザイン
   ========================================================================== */

@media (max-width: 768px) {
    .sms-container {
        padding: 0 15px;
    }
    
    .sms-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .sms-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sms-form {
        max-width: 100%;
    }
    
    .sms-scraping-sites {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .sms-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .sms-table {
        font-size: 12px;
    }
    
    .sms-table th,
    .sms-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .sms-scraping-sites {
        grid-template-columns: 1fr;
    }
    
    .sms-dashboard-stat {
        padding: 20px;
    }
    
    .sms-dashboard-stat-number {
        font-size: 28px;
    }
}

/* ==========================================================================
   アニメーション
   ========================================================================== */

@keyframes sms-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

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

.sms-fade-in {
    animation: sms-fade-in 0.5s ease-out;
}

/* ==========================================================================
   ユーティリティクラス
   ========================================================================== */

.sms-text-center { text-align: center; }
.sms-text-left { text-align: left; }
.sms-text-right { text-align: right; }

.sms-mt-10 { margin-top: 10px; }
.sms-mt-20 { margin-top: 20px; }
.sms-mt-30 { margin-top: 30px; }

.sms-mb-10 { margin-bottom: 10px; }
.sms-mb-20 { margin-bottom: 20px; }
.sms-mb-30 { margin-bottom: 30px; }

.sms-hidden { display: none; }
.sms-visible { display: block; }

.sms-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.sms-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: sms-spin 1s linear infinite;
}

/* ==========================================================================
   スクレイピングフォーム用タブスタイル
   ========================================================================== */

.sms-tabs {
    margin-bottom: 30px;
}

.sms-tab-nav {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.sms-tab-nav a {
    padding: 12px 24px;
    text-decoration: none;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.sms-tab-nav a:hover {
    color: #0073aa;
}

.sms-tab-nav a.active {
    border-bottom-color: #0073aa;
    color: #0073aa;
    font-weight: 600;
}

.sms-tab-content {
    display: none;
}

.sms-tab-content.active {
    display: block;
}

/* Blog styles */
.sms-blog-list {
    display: grid;
    gap: 24px;
}

.sms-blog-card,
.sms-blog-article {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    padding: 28px;
}

.sms-blog-card h3,
.sms-blog-article h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 600;
}

.sms-blog-meta {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 16px;
}

.sms-link-more,
.sms-link-back {
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
}

.sms-link-more:hover,
.sms-link-back:hover {
    text-decoration: underline;
}
