/* ============================================================
   FotoDigital Photobook - Social & Cloud Import Styles
   ============================================================ */

/* ── Source Buttons ───────────────────────────────────────── */

.mc-source-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--mc-border, #e0e0e0);
    background: #fff;
}

.mc-source-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    white-space: nowrap;
    line-height: 1;
}

.mc-source-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.mc-source-btn:active {
    transform: translateY(0);
    opacity: 1;
}

.mc-source-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mc-source-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.mc-source-label {
    display: inline-block;
}

/* On narrow panels, hide label and show icon only */
@media (max-width: 360px) {
    .mc-source-label { display: none; }
    .mc-source-btn { padding: 6px 8px; }
}

/* ── Social Modal ────────────────────────────────────────── */

.mc-social-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-social-modal-inner {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: mc-social-fadein 0.2s ease;
}

@keyframes mc-social-fadein {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.mc-social-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--mc-border, #e0e0e0);
    background: #fafafa;
    flex-shrink: 0;
}

.mc-social-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--mc-text, #263238);
}

.mc-social-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.mc-social-modal-close:hover {
    color: #333;
}

.mc-social-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 200px;
}

.mc-social-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--mc-border, #e0e0e0);
    background: #fafafa;
    flex-shrink: 0;
}

/* ── Photo Grid ──────────────────────────────────────────── */

.mc-social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mc-social-photo {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
}

.mc-social-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mc-social-photo:hover {
    transform: scale(1.02);
}

.mc-social-photo-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}

.mc-social-photo:hover .mc-social-photo-check {
    opacity: 1;
}

.mc-social-photo-check svg {
    width: 14px;
    height: 14px;
    stroke: transparent;
    transition: stroke 0.15s;
}

.mc-social-photo.selected {
    border-color: var(--mc-primary, #2196F3);
}

.mc-social-photo.selected .mc-social-photo-check {
    opacity: 1;
    background: var(--mc-primary, #2196F3);
    border-color: var(--mc-primary, #2196F3);
}

.mc-social-photo.selected .mc-social-photo-check svg {
    stroke: #fff;
}

/* ── Albums ──────────────────────────────────────────────── */

.mc-social-albums {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mc-social-album-card {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--mc-border, #e0e0e0);
    transition: box-shadow 0.2s, transform 0.15s;
    background: #fff;
}

.mc-social-album-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.mc-social-album-cover {
    width: 100%;
    aspect-ratio: 16/10;
    background-size: cover;
    background-position: center;
    background-color: #eee;
}

.mc-social-album-info {
    padding: 8px 10px;
}

.mc-social-album-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-text, #263238);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mc-social-album-count {
    display: block;
    font-size: 11px;
    color: var(--mc-text-light, #78909C);
    margin-top: 2px;
}

/* ── Import Progress ─────────────────────────────────────── */

.mc-import-progress {
    flex: 1;
    position: relative;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.mc-import-progress-bar {
    height: 100%;
    background: var(--mc-primary, #2196F3);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.mc-import-progress-text {
    font-size: 12px;
    color: var(--mc-text-light, #78909C);
    white-space: nowrap;
    margin-top: 4px;
    display: block;
    text-align: center;
}

.mc-import-status {
    max-width: 400px;
    margin: 40px auto;
    text-align: center;
}

.mc-import-status .mc-import-progress {
    height: 10px;
    margin-bottom: 8px;
}

.mc-import-error-line {
    font-size: 11px;
    color: var(--mc-danger, #f44336);
    margin-top: 4px;
    text-align: left;
}

.mc-social-import-btn {
    padding: 8px 18px;
    background: var(--mc-primary, #2196F3);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    font-family: inherit;
}

.mc-social-import-btn:hover {
    background: var(--mc-primary-dark, #1976D2);
}

/* ── URL Import ──────────────────────────────────────────── */

.mc-url-import {
    max-width: 480px;
    margin: 0 auto;
}

.mc-url-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--mc-text, #263238);
    margin-bottom: 8px;
}

.mc-url-input-row {
    display: flex;
    gap: 8px;
}

.mc-url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--mc-border, #e0e0e0);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.mc-url-input:focus {
    border-color: var(--mc-primary, #2196F3);
}

.mc-url-preview-btn {
    padding: 8px 16px;
    background: #607D8B;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.15s;
}

.mc-url-preview-btn:hover {
    background: #455A64;
}

.mc-url-preview {
    margin-top: 14px;
    text-align: center;
    border: 1px solid var(--mc-border, #e0e0e0);
    border-radius: 6px;
    padding: 10px;
    background: #f5f5f5;
}

.mc-url-preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
}

.mc-url-error {
    margin-top: 10px;
    padding: 8px 12px;
    background: #FFF3E0;
    border: 1px solid #FFE0B2;
    border-radius: 6px;
    color: #E65100;
    font-size: 12px;
}

.mc-url-import-btn {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 10px;
    background: var(--mc-primary, #2196F3);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.mc-url-import-btn:hover {
    background: var(--mc-primary-dark, #1976D2);
}

.mc-url-import-btn:disabled {
    background: #bbb;
    cursor: not-allowed;
}

/* ── Status Messages ─────────────────────────────────────── */

.mc-social-loading,
.mc-social-empty,
.mc-social-error {
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    color: var(--mc-text-light, #78909C);
}

.mc-social-error {
    color: var(--mc-danger, #f44336);
}

/* ── Missing Config ──────────────────────────────────────── */

.mc-social-missing-config {
    text-align: center;
    padding: 30px 20px;
}

.mc-social-missing-config .mc-social-missing-icon {
    margin-bottom: 12px;
}

.mc-social-missing-config h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--mc-text, #263238);
    margin: 0 0 8px;
}

.mc-social-missing-config p {
    font-size: 13px;
    color: var(--mc-text-light, #78909C);
    margin: 4px 0;
    line-height: 1.5;
}

.mc-social-config-key code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #d32f2f;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 600px) {
    .mc-social-modal-inner {
        width: 96%;
        max-height: 92vh;
        border-radius: 8px;
    }

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

    .mc-social-albums {
        grid-template-columns: 1fr;
    }

    .mc-social-modal-footer {
        flex-direction: column;
    }
}
