/* Shared auth + My Stars glass modals */

#auth-modal.modal,
#user-stars-modal.modal {
    background: rgba(3, 6, 12, 0.58);
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
}

#user-stars-modal,
#user-stars-modal * {
    direction: ltr;
}

#user-stars-modal {
    text-align: left;
}

#auth-modal .modal-content {
    width: min(420px, calc(100vw - 32px));
    max-width: 420px;
    max-height: min(92vh, 720px);
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(24, 29, 41, 0.78), rgba(8, 10, 18, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.94);
}

#auth-modal .modal-header {
    padding: 20px 22px 8px;
    border: 0;
    background: transparent;
    border-radius: 18px 18px 0 0;
}

#auth-modal .modal-header h2 {
    margin: 0;
    color: #fff;
    font: 700 22px/1.2 'Inter', 'Segoe UI', sans-serif;
    letter-spacing: 0;
}

#auth-modal .modal-body {
    padding: 12px 22px 22px;
}

#auth-modal #login-form,
#auth-modal #auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#auth-modal .form-group {
    margin: 0;
}

#auth-modal .form-group label {
    display: block;
    margin: 0 0 7px;
    color: rgba(255, 255, 255, 0.7);
    font: 600 12px/1.2 'Inter', 'Segoe UI', sans-serif;
}

#auth-modal input {
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 0 14px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    color: #fff;
    font: 500 14px 'Inter', 'Segoe UI', sans-serif;
    outline: none;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#auth-modal input:focus {
    background: rgba(255, 255, 255, 0.105);
    border-color: rgba(120, 210, 255, 0.48);
    box-shadow: 0 0 0 3px rgba(120, 210, 255, 0.12);
}

#auth-modal #login-submit,
#auth-modal #auth-submit-btn,
#auth-modal #register-submit,
#auth-modal .google-signin-btn {
    width: 100%;
    min-height: 46px;
    margin: 0;
    border-radius: 12px;
    font: 700 14px 'Inter', 'Segoe UI', sans-serif;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease;
}

#auth-modal #login-submit,
#auth-modal #auth-submit-btn {
    background: rgba(108, 207, 255, 0.2);
    border: 1px solid rgba(108, 207, 255, 0.42);
    color: #fff;
}

#auth-modal #register-submit {
    background: rgba(255, 255, 255, 0.075) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

#auth-modal .google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.72);
    color: #1f2937;
}

#auth-modal #login-submit:hover,
#auth-modal #auth-submit-btn:hover,
#auth-modal #register-submit:hover,
#auth-modal .google-signin-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.32);
}

#auth-modal .auth-divider {
    margin: 16px 0;
    color: rgba(255, 255, 255, 0.45);
}

#auth-modal .auth-switch {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.66);
    text-align: center;
    font: 500 13px 'Inter', 'Segoe UI', sans-serif;
}

#auth-modal .auth-switch p {
    margin: 0;
}

#auth-modal .link-btn,
#auth-modal .auth-switch a {
    color: rgba(133, 216, 255, 0.96) !important;
    text-decoration: none;
    font-weight: 700;
}

#auth-modal .close-btn {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.78);
    font-size: 20px;
}

#user-stars-modal .modal-content.large {
    width: min(1120px, calc(100vw - 48px));
    max-width: 1120px;
    max-height: min(86vh, 860px);
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(18, 22, 32, 0.82), rgba(8, 10, 18, 0.72));
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#user-stars-modal .modal-header {
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.035);
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px 18px 0 0;
}

#user-stars-modal .modal-header h2 {
    color: #fff;
    font: 700 28px/1.15 'Inter', 'Segoe UI', sans-serif;
    letter-spacing: 0;
}

#user-stars-modal .modal-body {
    padding: 16px 18px 20px;
    overflow: auto;
    max-height: calc(min(86vh, 860px) - 68px);
}

#user-stars-navigation {
    margin-bottom: 14px;
}

#user-stars-modal .nav-shortcuts,
#user-stars-modal #help-btn,
#user-stars-modal #help-dropdown {
    display: none !important;
}

.search-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 16px;
}

#stars-search {
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    font: 500 14px 'Inter', 'Segoe UI', sans-serif;
}

#stars-search:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.1);
}

.stars-filter-btn,
#search-stars-btn,
#refresh-stars-btn {
    height: 42px;
    padding: 0 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    font: 700 13px 'Inter', 'Segoe UI', sans-serif;
}

#refresh-stars-btn {
    width: 42px;
    padding: 0;
}

#stars-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.star-card {
    position: relative;
    overflow: visible;
    padding: 0;
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.star-screenshot {
    width: 100%;
    height: 118px;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.star-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.star-screenshot-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(21, 25, 40, 0.9), rgba(10, 12, 22, 0.95));
    color: rgba(255, 255, 255, 0.42);
    font-size: 12px;
}

.star-card-content {
    padding: 14px;
}

.star-card-header,
.star-card-side,
.star-actions,
.star-meta-row {
    display: flex;
}

.star-card-header {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.star-title-stack {
    min-width: 0;
    flex: 1;
}

.star-name {
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font: 700 18px/1.22 'Inter', 'Segoe UI', sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.star-system-line {
    margin-top: 7px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.star-card-side {
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.star-color-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.star-meta-row {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin: 0 0 13px;
    padding-top: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.star-card-menu {
    position: relative;
}

.star-more-btn {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.star-more-menu {
    position: absolute;
    top: 42px;
    right: 0;
    width: 156px;
    padding: 6px;
    background: rgba(14, 17, 27, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    z-index: 30;
}

.star-menu-item {
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font: 700 12px 'Inter', 'Segoe UI', sans-serif;
    text-align: left;
}

.star-menu-item:hover,
.star-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.star-menu-item.danger:hover {
    background: rgba(255, 80, 96, 0.16);
    color: #ffb8c0;
}

.star-actions {
    gap: 7px;
}

.star-action-btn {
    flex: 1;
    min-height: 32px;
    padding: 10px 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font: 700 11px 'Inter', 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#no-stars,
#stars-loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
}

@media (max-width: 960px) {
    #stars-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    #user-stars-modal .modal-content.large {
        width: calc(100vw - 20px);
    }

    .search-section {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    #search-stars-btn {
        display: none;
    }

    #stars-grid {
        grid-template-columns: 1fr;
    }
}
