/* File Permission Checker - mobile-first */

/* --- Tool section --- */
.fpc-tool {
    --fpc-radius: 12px;
    --fpc-radius-sm: 8px;
    --fpc-border: 1px solid rgba(0, 0, 0, 0.08);
    --fpc-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --fpc-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.08);
    --fpc-primary: #2563eb;
    --fpc-primary-hover: #1d4ed8;
    --fpc-bg-subtle: #f8fafc;
    --fpc-text: #0f172a;
    --fpc-text-muted: #64748b;
    --fpc-danger: #dc2626;
    --fpc-success: #16a34a;
    --fpc-warning: #d97706;
    margin-bottom: 2rem;
}

/* Card layout: left inputs, right results */
.fpc-card {
    border: var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: #fff;
    box-shadow: var(--fpc-shadow);
    overflow: hidden;
}

.fpc-card-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.fpc-card-left {
    padding: 1.5rem;
    border-bottom: var(--fpc-border);
}

.fpc-card-right {
    padding: 1.5rem;
    background: var(--fpc-bg-subtle);
}

.fpc-result-area {
    min-height: 280px;
    position: relative;
}

.fpc-result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    padding: 2rem;
    text-align: center;
}

.fpc-result-placeholder[aria-hidden="true"] {
    display: none;
}

.fpc-result-placeholder-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 0.75rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.25'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0.7;
}

.fpc-result-placeholder p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fpc-text-muted);
    margin: 0 0 0.35rem 0;
}

.fpc-result-placeholder-hint {
    font-size: 0.875rem;
    color: var(--fpc-text-muted);
    max-width: 280px;
    line-height: 1.4;
}

/* Result panels inside right column - remove extra margin from first */
.fpc-card-right .fpc-progress,
.fpc-card-right .fpc-result-panel {
    margin-top: 1rem;
}

.fpc-card-right .fpc-progress:first-of-type,
.fpc-card-right .fpc-result-panel:first-of-type {
    margin-top: 0;
}

/* Drop zone */
.fpc-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 2rem 1.5rem;
    border: 2px dashed var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: var(--fpc-bg-subtle);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    border-color: rgba(0, 0, 0, 0.12);
}

.fpc-drop:hover,
.fpc-drop:focus-visible {
    border-color: var(--fpc-primary);
    background: rgba(37, 99, 235, 0.04);
    box-shadow: var(--fpc-shadow);
    outline: none;
}

.fpc-drop.fpc-drop-over {
    border-color: var(--fpc-primary);
    background: rgba(37, 99, 235, 0.08);
}

.fpc-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.fpc-drop-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5'/%3E%3C/svg%3E") center/contain no-repeat;
}

.fpc-drop-title {
    font-weight: 600;
    font-size: 1.0625rem;
    color: var(--fpc-text);
}

.fpc-drop-hint {
    font-size: 0.875rem;
    color: var(--fpc-text-muted);
    margin-top: 0.25rem;
}

/* Quick analyze */
.fpc-quick {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border: var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: #fff;
    box-shadow: var(--fpc-shadow);
}

.fpc-quick-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--fpc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.fpc-quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}

.fpc-quick-field {
    flex: 1 1 120px;
    min-width: 0;
}

.fpc-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--fpc-text);
    margin-bottom: 0.35rem;
}

.fpc-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    border: var(--fpc-border);
    border-radius: var(--fpc-radius-sm);
    background: #fff;
    color: var(--fpc-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fpc-input:focus {
    border-color: var(--fpc-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.fpc-input::placeholder {
    color: var(--fpc-text-muted);
}

.fpc-quick-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Buttons */
.fpc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    border: none;
    border-radius: var(--fpc-radius-sm);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.fpc-btn-primary {
    background: var(--fpc-primary);
    color: #fff;
}

.fpc-btn-primary:hover {
    background: var(--fpc-primary-hover);
}

.fpc-btn-secondary {
    background: var(--fpc-bg-subtle);
    color: var(--fpc-text);
}

.fpc-btn-secondary:hover {
    background: #e2e8f0;
}

.fpc-btn-outline {
    background: transparent;
    color: var(--fpc-primary);
    border: 1px solid var(--fpc-primary);
}

.fpc-btn-outline:hover {
    background: rgba(37, 99, 235, 0.08);
}

.fpc-btn-ghost {
    background: transparent;
    color: var(--fpc-text-muted);
}

.fpc-btn-ghost:hover {
    background: var(--fpc-bg-subtle);
    color: var(--fpc-text);
}

.fpc-btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
}

.fpc-btn-icon {
    width: 1.125rem;
    height: 1.125rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23fff' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Files list */
.fpc-files-wrap {
    margin-top: 1.5rem;
}

.fpc-heading-sm {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fpc-text);
    margin: 0 0 0.5rem 0;
}

.fpc-files-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fpc-files-list .fpc-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: var(--fpc-border);
    border-radius: var(--fpc-radius-sm);
    background: #fff;
    box-shadow: var(--fpc-shadow);
}

.fpc-file-item-info strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--fpc-text);
}

.fpc-file-item-meta {
    font-size: 0.8125rem;
    color: var(--fpc-text-muted);
    margin-top: 0.2rem;
}

.fpc-file-item-remove {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: var(--fpc-radius-sm);
    background: transparent;
    color: var(--fpc-text-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.fpc-file-item-remove:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--fpc-danger);
}

/* Options */
.fpc-options {
    margin-top: 1.5rem;
    border: var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: #fff;
    box-shadow: var(--fpc-shadow);
    overflow: hidden;
}

.fpc-options-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--fpc-text);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.fpc-options-toggle:hover {
    background: var(--fpc-bg-subtle);
}

.fpc-options-chevron {
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") center/contain no-repeat;
    transition: transform 0.2s;
}

.fpc-options-toggle[aria-expanded="true"] .fpc-options-chevron {
    transform: rotate(180deg);
}

.fpc-options-panel {
    padding: 0 1.25rem 1rem;
}

.fpc-options-panel[aria-hidden="true"] {
    display: none;
}

.fpc-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem 1rem;
}

.fpc-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: var(--fpc-text);
    cursor: pointer;
}

.fpc-check input {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--fpc-primary);
}

/* Actions */
.fpc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Progress */
.fpc-progress {
    margin-top: 1.5rem;
    padding: 1rem;
    border: var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: var(--fpc-bg-subtle);
}

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

.fpc-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    max-width: 100%;
    background: var(--fpc-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.fpc-progress-text {
    font-size: 0.875rem;
    color: var(--fpc-text-muted);
    margin: 0.5rem 0 0 0;
}

/* Result panels */
.fpc-result-panel {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border: var(--fpc-border);
    border-radius: var(--fpc-radius);
    background: #fff;
    box-shadow: var(--fpc-shadow);
}

.fpc-result-panel .fpc-heading-sm {
    margin-top: 0;
}

.fpc-result-body {
    margin-top: 0.75rem;
    font-size: 0.9375rem;
    color: var(--fpc-text);
}

.fpc-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Manual analysis breakdown */
.fpc-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.fpc-breakdown-item {
    padding: 0.75rem;
    border-radius: var(--fpc-radius-sm);
    background: var(--fpc-bg-subtle);
}

.fpc-breakdown-item h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: capitalize;
    margin: 0 0 0.35rem 0;
    color: var(--fpc-text);
}

.fpc-breakdown-item .fpc-digit {
    font-weight: 600;
    color: var(--fpc-primary);
}

.fpc-breakdown-item small {
    display: block;
    font-size: 0.8125rem;
    color: var(--fpc-text-muted);
    margin-top: 0.25rem;
}

.fpc-alert {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--fpc-radius-sm);
    font-size: 0.9375rem;
}

.fpc-alert-warning {
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.3);
    color: #92400e;
}

.fpc-alert-warning ul {
    margin: 0.35rem 0 0 1.25rem;
    padding: 0;
}

.fpc-alert-info {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: #1e40af;
}

.fpc-alert-info ul {
    margin: 0.35rem 0 0 1.25rem;
    padding: 0;
}

/* Results table (file analysis) */
.fpc-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.fpc-results-table th,
.fpc-results-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: var(--fpc-border);
}

.fpc-results-table th {
    font-weight: 600;
    color: var(--fpc-text-muted);
}

.fpc-results-table td {
    color: var(--fpc-text);
}

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

.fpc-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

.fpc-badge-success {
    background: rgba(22, 163, 74, 0.15);
    color: var(--fpc-success);
}

.fpc-badge-warning {
    background: rgba(217, 119, 6, 0.15);
    color: var(--fpc-warning);
}

/* Educational section */
.fpc-edu {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: var(--fpc-border);
}

.fpc-edu-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fpc-text);
    margin: 0 0 0.75rem 0;
}

.fpc-edu-lead {
    font-size: 0.9375rem;
    color: var(--fpc-text-muted);
    line-height: 1.6;
    max-width: 720px;
    margin: 0 0 1.5rem 0;
}

.fpc-edu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.fpc-edu-block {
    padding: 1rem;
    border-radius: var(--fpc-radius-sm);
    background: var(--fpc-bg-subtle);
}

.fpc-edu-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fpc-text);
    margin: 0 0 0.35rem 0;
}

.fpc-edu-block p {
    font-size: 0.9375rem;
    color: var(--fpc-text-muted);
    line-height: 1.5;
    margin: 0;
}

.fpc-edu-footer {
    font-size: 0.9375rem;
    color: var(--fpc-text-muted);
    margin: 0;
}

.fpc-edu-footer a {
    color: var(--fpc-primary);
    text-decoration: none;
}

.fpc-edu-footer a:hover {
    text-decoration: underline;
}

/* Desktop */
@media (min-width: 640px) {
    .fpc-quick-row {
        align-items: flex-end;
    }

    .fpc-quick-field {
        flex: 0 1 140px;
    }

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

@media (min-width: 768px) {
    .fpc-card-inner {
        flex-direction: row;
        align-items: stretch;
    }

    .fpc-card-left {
        border-bottom: none;
        border-right: var(--fpc-border);
    }

    .fpc-card-right {
        flex: 1;
        min-width: 0;
    }

    .fpc-result-area {
        min-height: 320px;
    }

    .fpc-drop {
        min-height: 200px;
    }

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