/**
 * SharePoint Integration Styles
 * Mirrors Box integration layout with Microsoft/SharePoint teal branding.
 */

/* Container */
.sp-integration-container {
    background: linear-gradient(135deg, #edf6f7 0%, #f8fafc 100%);
    border: 1px solid #b8dde0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

/* Connect Section */
.sp-connect-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Icon */
.sp-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #038387 0%, #00b7c3 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.sp-icon-connected {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.sp-icon-synced {
    background: linear-gradient(135deg, #025d60 0%, #038387 100%);
}

/* Content */
.sp-connect-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sp-connect-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sp-connect-content strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.sp-connect-content p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.3;
}

/* Inline actions */
.sp-inline-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Connect Button */
.sp-connect-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #038387 0%, #00b7c3 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sp-connect-btn:hover {
    background: linear-gradient(135deg, #025d60 0%, #038387 100%);
    box-shadow: 0 4px 12px rgba(3, 131, 135, 0.25);
}

/* Select Folder Button */
.sp-select-folder-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #0f172a;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sp-select-folder-btn:hover {
    background: #1e293b;
}

/* Sync Now Button */
.sp-sync-now-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #025d60 0%, #038387 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sp-sync-now-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #01484b 0%, #025d60 100%);
}

.sp-sync-now-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Small icon buttons */
.sp-change-folder-btn,
.sp-disconnect-btn {
    background: none;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.sp-change-folder-btn:hover {
    background: #f1f5f9;
    color: #038387;
    border-color: #cbd5e1;
}

.sp-disconnect-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Progress bar */
.sp-sync-progress {
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.sp-progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.sp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #038387 0%, #10b981 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.sp-progress-text {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    text-align: right;
}

/* ===== Picker Modal ===== */
.sp-picker-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
}

.sp-picker-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.sp-picker-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 550px;
    max-height: 75vh;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.sp-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.sp-picker-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-picker-header h3 i { color: #038387; }

.sp-picker-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.sp-picker-close:hover { color: #64748b; }

/* Breadcrumb */
.sp-picker-breadcrumb {
    padding: 10px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.sp-breadcrumb-link {
    color: #038387;
    cursor: pointer;
}

.sp-breadcrumb-link:hover { text-decoration: underline; }

.sp-breadcrumb-current {
    color: #1e293b;
    font-weight: 500;
}

.sp-picker-breadcrumb i.fa-chevron-right {
    font-size: 9px;
    color: #cbd5e1;
}

/* Toolbar (search) */
.sp-picker-toolbar {
    padding: 8px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.sp-site-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.sp-site-search:focus {
    border-color: #038387;
    box-shadow: 0 0 0 2px rgba(3, 131, 135, 0.15);
}

/* Picker Body */
.sp-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 18px;
    min-height: 200px;
    max-height: 340px;
}

.sp-picker-loading {
    text-align: center;
    padding: 30px;
    color: #64748b;
}

.sp-picker-loading i {
    font-size: 20px;
    color: #038387;
    margin-bottom: 6px;
    display: block;
}

.sp-picker-empty {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
}

.sp-picker-error {
    text-align: center;
    padding: 30px;
    color: #dc2626;
}

/* List items (sites, drives, folders) */
.sp-site-item,
.sp-drive-item,
.sp-folder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 3px 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.sp-site-item:hover,
.sp-drive-item:hover,
.sp-folder-item:hover {
    background: #e6f4f5;
    border-color: #038387;
}

.sp-site-item i.fa-globe { color: #038387; font-size: 16px; }
.sp-drive-item i.fa-database { color: #6366f1; font-size: 16px; }
.sp-folder-item i.fa-folder { color: #fbbf24; font-size: 16px; }

.sp-site-item span,
.sp-drive-item span,
.sp-folder-item span {
    flex: 1;
    font-size: 13px;
    color: #1e293b;
}

.sp-item-arrow {
    color: #94a3b8;
    font-size: 11px;
}

.sp-file-count {
    padding: 10px 12px;
    margin-top: 10px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 12px;
    color: #64748b;
}

.sp-file-count i { color: #94a3b8; margin-right: 5px; }

/* Picker Footer */
.sp-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

.sp-picker-info {
    font-size: 12px;
    color: #64748b;
}

.sp-picker-info strong { color: #1e293b; }

.sp-select-this-folder-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sp-select-this-folder-btn:hover { background: #059669; }

/* Notices */
.sp-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 10px;
    animation: spSlideIn 0.3s ease;
}

@keyframes spSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sp-notice-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.sp-notice-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.sp-notice-info {
    background: #e6f4f5;
    color: #025d60;
    border: 1px solid #99d5d8;
}

.sp-notice-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.6;
    line-height: 1;
    padding: 0;
}

.sp-notice-close:hover { opacity: 1; }

/* Loading */
.sp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: #64748b;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 600px) {
    .sp-connect-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .sp-inline-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .sp-picker-content {
        width: 95%;
        max-height: 85vh;
    }

    .sp-picker-footer {
        flex-direction: column;
        gap: 10px;
    }
}
