/* === Landing Page === */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 53px);
    padding: 24px 16px;
    gap: 28px;
}

/* Logo block */
.landing__logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.landing__logo-icon {
    width: 64px;
    height: 64px;
    color: #4fc3f7;
}

.landing__title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
}

.landing__subtitle {
    font-size: 14px;
    color: #9e9e9e;
}

/* === Auth Status Card === */
.auth-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 32px;
    border-radius: 16px;
    background: #1e1e1e;
    border: 1px solid #333;
    min-width: 280px;
    transition: border-color .3s, background .3s;
}

.auth-status--logged-in {
    border-color: #43a047;
    background: #1b2e1b;
}

.auth-status__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: color .3s;
}

.auth-status--logged-in .auth-status__icon {
    color: #4fc3f7;
}

.auth-status__text {
    font-size: 14px;
    color: #9e9e9e;
    text-align: center;
}

.auth-status--logged-in .auth-status__text {
    color: #81c784;
}

/* Error state — token revoked / permissions removed */
.auth-status--error {
    border-color: #ef5350;
    background: #2e1b1b;
}

.auth-status--error .auth-status__icon {
    color: #ef5350;
}

.auth-status--error .auth-status__text {
    color: #ef9a9a;
}

.auth-status--error .auth-status__user {
    color: #ef9a9a;
    font-weight: 400;
    font-size: 12px;
}

.auth-status__user {
    font-size: 13px;
    color: #bbb;
    font-weight: 500;
}

/* === Buttons (landing overrides) === */
.btn {
    padding: 14px 32px;
}

.btn__icon {
    width: 22px;
    height: 22px;
}

/* OneDrive branded button */
.btn--onedrive {
    background: #0078d4;
    color: #fff;
}

.btn--onedrive:hover {
    background: #106ebe;
}

.btn--onedrive.btn--logout {
    background: #ef5350;
}

.btn--onedrive.btn--logout:hover {
    background: #d32f2f;
}

.btn--go {
    font-size: 17px;
    padding: 16px 36px;
}

/* === Responsive === */
@media (max-width: 480px) {
    .landing {
        padding: 20px 12px;
        gap: 24px;
    }

    .landing__logo-icon {
        width: 52px;
        height: 52px;
    }

    .landing__title {
        font-size: 24px;
    }

    .auth-status {
        min-width: auto;
        width: 100%;
        padding: 16px 20px;
    }

    .btn--go {
        width: 100%;
    }

    .folder-setting {
        width: 100%;
    }

    .folder-modal__dialog {
        max-width: 100%;
    }
}

/* === Folder Setting Card === */
.folder-setting {
    display: flex;
    flex-direction: column;
    min-width: 280px;
    border-radius: 12px;
    background: #1e1e1e;
    border: 1px solid #333;
    overflow: hidden;
    transition: border-color .3s;
}

.folder-setting__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.folder-setting__icon {
    width: 28px;
    height: 28px;
    color: #4fc3f7;
    flex-shrink: 0;
}

.folder-setting__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.folder-setting__label {
    font-size: 11px;
    color: #9e9e9e;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.folder-setting__path {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-setting__change {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    color: #9e9e9e;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s, color .2s;
}

.folder-setting__change:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}

/* === Folder Picker Bottom Sheet === */
.folder-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s .3s;
}

.folder-modal--open {
    visibility: visible;
    pointer-events: auto;
    transition: visibility 0s;
}

.folder-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.65);
    opacity: 0;
    transition: opacity .3s;
}

.folder-modal--open .folder-modal__backdrop {
    opacity: 1;
}

.folder-modal__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    max-height: 85dvh;
    background: #1e1e1e;
    border-radius: 16px 16px 0 0;
    border: 1px solid #333;
    border-bottom: none;
    overflow: hidden;
    box-shadow: 0 -8px 48px rgba(0,0,0,.4);
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.32, .72, 0, 1);
}

.folder-modal--open .folder-modal__dialog {
    transform: translateY(0);
}

/* Drag handle */
.folder-modal__handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 2px;
    cursor: grab;
    flex-shrink: 0;
}

.folder-modal__handle::before {
    content: '';
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #555;
}

.folder-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

.folder-modal__title {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
}

.folder-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #9e9e9e;
    font-size: 24px;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.folder-modal__close:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

/* Breadcrumb */
.folder-modal__breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    border-bottom: 1px solid #2a2a2a;
    overflow-x: auto;
    flex-shrink: 0;
}

.folder-modal__crumb {
    border: none;
    background: none;
    color: #4fc3f7;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    white-space: nowrap;
    transition: background .2s;
}

.folder-modal__crumb:hover {
    background: rgba(255,255,255,.08);
}

.folder-modal__crumb--active {
    color: #fff;
    font-weight: 500;
    cursor: default;
}

.folder-modal__crumb--active:hover {
    background: none;
}

.folder-modal__crumb-sep {
    color: #555;
    font-size: 14px;
    flex-shrink: 0;
}

/* Folder list */
.folder-modal__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    min-height: 160px;
}

.folder-modal__loading,
.folder-modal__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: #9e9e9e;
    font-size: 14px;
}

.folder-modal__item {
    display: flex;
    align-items: center;
    width: 100%;
    transition: background .15s;
}

.folder-modal__item:hover {
    background: rgba(255,255,255,.06);
}

.folder-modal__item--selected {
    background: rgba(79,195,247,.12);
    border-left: 3px solid #4fc3f7;
}

.folder-modal__item--selected .folder-modal__item-row {
    padding-left: 17px;
}

.folder-modal__item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 10px 0 10px 20px;
    border: none;
    background: transparent;
    color: #e0e0e0;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.folder-modal__item-icon {
    width: 22px;
    height: 22px;
    color: #ffb74d;
    flex-shrink: 0;
}

.folder-modal__item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-modal__item-count {
    font-size: 12px;
    color: #777;
    flex-shrink: 0;
}

.folder-modal__item-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: #555;
    cursor: pointer;
    flex-shrink: 0;
    transition: color .15s, background .15s;
    border-radius: 8px;
}

.folder-modal__item-arrow:hover {
    background: rgba(255,255,255,.1);
    color: #4fc3f7;
}

.folder-modal__item-arrow:active {
    background: rgba(79,195,247,.2);
    color: #4fc3f7;
}

/* Create folder row */
.folder-modal__create {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-top: 1px solid #2a2a2a;
}

.folder-modal__input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #2a2a2a;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}

.folder-modal__input:focus {
    border-color: #4fc3f7;
}

.folder-modal__create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #4fc3f7;
    color: #000;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s;
}

.folder-modal__create-btn:hover {
    background: #29b6f6;
}

.folder-modal__create-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Footer / select button */
.folder-modal__footer {
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #333;
}

.folder-modal__select {
    width: 100%;
    justify-content: center;
}
