/* ============================================
   REST API クライアント - スタイルシート
   レンタルサーバ用静的ファイル
   ============================================ */

/* リセット & ベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* カラーパレット */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --success-hover: #059669;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* コンテナ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-dark) 100%);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.header h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.server-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.status-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.server-input {
    flex: 1;
    max-width: 400px;
    padding: 0.75rem 1rem;
    background: var(--bg-darker);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.server-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* メインコンテンツ */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* セクション */
.section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ボタングリッド */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

/* ボタン */
.btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-icon {
    font-size: 1.3rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 400px;
    height: 400px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #7c3aed 100%);
    box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #14b8a6 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-hover) 0%, #0d9488 100%);
    box-shadow: 0 8px 16px -4px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #f97316 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning-hover) 0%, #ea580c 100%);
    box-shadow: 0 8px 16px -4px rgba(245, 158, 11, 0.4);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

/* フォーム */
.custom-request-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.form-group label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-darker);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
}

/* ローディング */
.loading {
    text-align: center;
    padding: 2.5rem;
    background: var(--bg-card);
    border-radius: 16px;
    border: 2px solid var(--primary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border: 5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* レスポンス情報 */
.response-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-card {
    background: var(--bg-darker);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.info-value {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
}

.status-value {
    color: var(--primary);
}

/* レスポンスコンテナ */
.response-container {
    background: var(--bg-darker);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.response-container:last-child {
    margin-bottom: 0;
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.response-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.response-content {
    padding: 1.5rem;
    margin: 0;
    background: #0a0a0a;
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.headers-content {
    color: #60a5fa;
}

/* スクロールバー */
.response-content::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.response-content::-webkit-scrollbar-track {
    background: #000;
}

.response-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 6px;
}

.response-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* 通知 */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.notification.error {
    background: var(--danger);
    color: white;
}

.notification.info {
    background: var(--primary);
    color: white;
}

/* フッター */
.footer {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

.footer-note {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--warning);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

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

    .form-row {
        flex-direction: column;
    }

    .server-status {
        flex-direction: column;
    }

    .server-input {
        max-width: 100%;
    }

    .notification {
        left: 1rem;
        right: 1rem;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.5s ease-out;
}