/**
 * AI Bridge Downloader - Frontend Styles
 * Version: 1.0.8
 * Powered by AI Bridge Inc. - https://aibridge.jp/
 */

.abd-download-form {
    max-width: 480px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: var(--font-family, "Noto Sans JP", sans-serif);
}

.abd-form-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.abd-form-header h3 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #2c3e50;
}

.abd-file-name {
    font-size: 16px;
    font-weight: 600;
    color: #2980b9;
    margin: 0 0 5px;
}

.abd-file-desc {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.abd-step {
    display: none;
}

.abd-step.active {
    display: block;
}

.abd-step > p {
    margin: 0 0 15px;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.abd-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.abd-input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    outline: none;
}

.abd-input-group input:focus {
    border-color: #2980b9;
}

.abd-input-group input::placeholder {
    color: #aaa;
}

.abd-btn {
    padding: 12px 24px;
    background: #2980b9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    white-space: nowrap;
}

.abd-btn:hover {
    background: #2471a3;
    transform: translateY(-1px);
}

.abd-btn:active {
    transform: translateY(0);
}

.abd-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.abd-btn-download {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    background: #27ae60;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.abd-btn-download:hover {
    background: #229954;
}

.abd-btn-download .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.abd-message {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    display: none;
}

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

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

.abd-resend {
    margin: 10px 0 0;
    font-size: 13px;
    text-align: center;
}

.abd-resend-link {
    color: #2980b9;
    text-decoration: none;
}

.abd-resend-link:hover {
    text-decoration: underline;
}

.abd-success {
    text-align: center;
    font-size: 16px;
    color: #27ae60;
    font-weight: 600;
    margin-bottom: 20px !important;
}

/* Loading state */
.abd-btn.loading {
    position: relative;
    color: transparent;
}

.abd-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: abd-spin 0.8s linear infinite;
}

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

/* Code input styling */
.abd-code-input {
    text-align: center;
    font-size: 20px !important;
    letter-spacing: 6px;
    font-family: monospace;
    width: 250px !important;
    max-width: 250px !important;
    flex: 0 0 250px !important;
}

.abd-code-input::placeholder {
    font-size: 13px !important;
    letter-spacing: 0 !important;
}

/* Responsive */
@media (max-width: 480px) {
    .abd-download-form {
        padding: 20px;
        margin: 0 15px;
    }

    .abd-input-group {
        flex-direction: column;
    }

    .abd-btn {
        width: 100%;
    }
}

/* Credit footer (do not remove) */
.abd-download-form::after {
    content: "Powered by AI Bridge Downloader";
    display: block;
    text-align: center;
    font-size: 11px;
    color: #aaa;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* ========================================
   File List Shortcode Styles
   ======================================== */

.abd-download-list {
    margin: 30px 0;
}

.abd-list-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.abd-file-grid {
    display: grid;
    gap: 25px;
}

.abd-file-grid.abd-columns-1 {
    grid-template-columns: 1fr;
}

.abd-file-grid.abd-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.abd-file-grid.abd-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.abd-file-grid.abd-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.abd-file-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.abd-file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.abd-file-card .abd-file-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    text-align: center;
}

.abd-file-card .abd-file-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #fff;
}

.abd-file-card .abd-file-info {
    padding: 20px;
}

.abd-file-card .abd-file-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.4;
}

.abd-file-card .abd-file-description {
    margin: 0 0 12px;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.abd-file-card .abd-file-size {
    margin: 0;
    font-size: 13px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 5px;
}

.abd-file-card .abd-file-size .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #2980b9;
}

.abd-file-card .abd-file-action {
    padding: 0 20px 20px;
}

/* Override form styles in card */
.abd-file-card .abd-download-form {
    max-width: 100%;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
}

.abd-file-card .abd-download-form::after {
    display: none;
}

.abd-file-card .abd-form-header {
    display: none;
}

.abd-file-card .abd-input-group {
    flex-direction: column;
}

.abd-file-card .abd-code-input {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
}

.abd-file-card .abd-btn {
    width: 100%;
}

.abd-file-card .abd-btn-download {
    font-size: 15px;
    padding: 14px;
}

.abd-no-files {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
}

/* Responsive for file list */
@media (max-width: 992px) {
    .abd-file-grid.abd-columns-4,
    .abd-file-grid.abd-columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .abd-file-grid.abd-columns-4,
    .abd-file-grid.abd-columns-3,
    .abd-file-grid.abd-columns-2 {
        grid-template-columns: 1fr;
    }

    .abd-file-card .abd-file-icon {
        padding: 20px;
    }

    .abd-file-card .abd-file-icon .dashicons {
        font-size: 36px;
        width: 36px;
        height: 36px;
    }
}

/* ========================================
   Simple List Style
   ======================================== */

.abd-simple-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.abd-simple-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: #fff;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.abd-simple-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.abd-simple-item:last-child {
    margin-bottom: 0;
}

.abd-simple-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.abd-simple-info .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #667eea;
}

.abd-simple-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.abd-simple-size {
    font-size: 13px;
    color: #888;
}

.abd-simple-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.abd-simple-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.abd-simple-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Inline form for list style */
.abd-inline-form {
    margin: 20px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #667eea;
}

.abd-inline-form .abd-download-form {
    max-width: 100%;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.abd-inline-form .abd-download-form::after {
    display: none;
}

/* Close button for inline form */
.abd-inline-form .abd-form-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
}

/* Responsive for list */
@media (max-width: 600px) {
    .abd-simple-item {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .abd-simple-info {
        width: 100%;
    }

    .abd-simple-btn {
        width: 100%;
        justify-content: center;
    }
}

/* NEW Badge - シンプル＆モダン */
.abd-new-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: 10px;
    vertical-align: middle;
    letter-spacing: 0.3px;
    line-height: 1;
}

/* Card style NEW badge */
.abd-file-card {
    position: relative;
}

.abd-file-card .abd-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    margin: 0;
    z-index: 10;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.abd-file-card.abd-is-new {
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
}

.abd-file-card.abd-is-new .abd-file-icon {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

/* ========================================
   License Manager Products
   ======================================== */

.abd-lm-product .abd-file-icon {
    position: relative;
}

.abd-lm-free .abd-file-icon {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.abd-lm-paid .abd-file-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.abd-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
}

.abd-badge-free {
    background: #dcfce7;
    color: #166534;
}

.abd-badge-paid {
    background: #dbeafe;
    color: #1e40af;
}

.abd-product-type {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 5px;
}

.abd-file-version {
    font-size: 13px;
    color: #666;
    margin: 10px 0 0;
}

.abd-btn-purchase {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.abd-btn-purchase:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.abd-btn-purchase .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* List Style - License Manager Products */
.abd-simple-version {
    font-size: 12px;
    color: #888;
    margin-left: 8px;
}

.abd-lm-product .abd-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.abd-simple-item .dashicons-admin-appearance,
.abd-simple-item .dashicons-admin-plugins {
    color: #667eea;
}

/* ========================================
   Two-Column Layout (List Style)
   ======================================== */

.abd-two-column {
    padding: 0 40px;
    box-sizing: border-box;
}

.abd-two-column .abd-list-container {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 0;
    min-height: 380px;
}

.abd-two-column .abd-list-left {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
}

.abd-two-column .abd-list-right {
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

.abd-two-column .abd-list-left .abd-simple-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.abd-two-column .abd-simple-item {
    padding: 14px 18px;
    margin-bottom: 0;
    cursor: pointer;
    border: 2px solid transparent;
    background: #fff;
}

.abd-two-column .abd-simple-item:hover {
    transform: none;
    border-color: #667eea;
}

.abd-two-column .abd-simple-item.abd-item-active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.abd-two-column .abd-simple-info {
    flex-wrap: wrap;
}

.abd-two-column .abd-simple-info .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.abd-two-column .abd-simple-name {
    font-size: 14px;
}

.abd-two-column .abd-simple-version {
    font-size: 11px;
}

/* Right Column - Detail Panel */
/* Note: width/overflow defined above */

.abd-detail-panel {
    display: none;
}

.abd-detail-panel.abd-panel-active {
    display: block;
}

.abd-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.abd-detail-header .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #667eea;
}

.abd-detail-header h4 {
    margin: 0;
    font-size: 22px;
    color: #2c3e50;
    flex: 1;
}

.abd-detail-type {
    background: #f0f4ff;
    color: #667eea;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.abd-detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.abd-meta-item {
    font-size: 14px;
    color: #555;
}

.abd-meta-item strong {
    color: #333;
}

.abd-detail-description {
    font-size: 15px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 25px;
    min-height: 80px;
}

.abd-detail-description.abd-no-desc {
    color: #999;
    font-style: italic;
}

.abd-detail-action {
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.abd-detail-action .abd-download-form {
    max-width: 100%;
    padding: 20px;
    box-shadow: none;
    background: #f8f9fa;
    border-radius: 10px;
}

.abd-detail-action .abd-form-header {
    display: none;
}

.abd-empty-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #999;
}

/* Responsive - Two Column */
@media (max-width: 900px) {
    .abd-two-column .abd-list-container {
        grid-template-columns: 1fr;
    }

    .abd-two-column .abd-list-left {
        max-height: none;
    }

    .abd-two-column .abd-simple-item.abd-item-active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .abd-two-column .abd-simple-item.abd-item-active .abd-simple-name,
    .abd-two-column .abd-simple-item.abd-item-active .abd-simple-version,
    .abd-two-column .abd-simple-item.abd-item-active .dashicons {
        color: #fff;
    }

    .abd-two-column .abd-simple-item.abd-item-active .abd-badge {
        background: rgba(255,255,255,0.2);
        color: #fff;
    }
}
