/* =============================================
   Admin Panel — Custom Styles
   ============================================= */

/* Hide scrollbar on admin article */
#admin {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    overflow-y: auto !important;
}

#admin::-webkit-scrollbar {
    display: none !important;
}

/* === SHOW/HIDE via class (JS controls .admin-hidden) === */
.admin-hidden {
    display: none !important;
}

/* Login View */
#admin-login-view {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    width: 100%;
}

/* Label */
#admin-login-view label[for="admin-password"] {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.4rem;
    border: none !important;
}

/* Password Input */
#admin-password {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 10px !important;
    padding: 0.9rem 1.2rem !important;
    color: #fff !important;
    font-size: 1rem !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
    box-sizing: border-box !important;
    outline: none !important;
}

#admin-password:focus {
    border-color: rgba(255, 255, 255, 0.55) !important;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.07) !important;
    background: rgba(255, 255, 255, 0.07) !important;
}

#admin-password::placeholder {
    color: rgba(255, 255, 255, 0.25) !important;
    letter-spacing: 3px;
}

/* Login Button */
#admin-login-btn {
    width: 100% !important;
    padding: 0.9rem 1rem !important;
    background: #ffffff !important;
    color: #111111 !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    letter-spacing: 2.5px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease !important;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1) !important;
    display: block !important;
    margin: 0 !important;
    line-height: normal !important;
}

#admin-login-btn:hover {
    background: #e8e8e8 !important;
    box-shadow: 0 6px 28px rgba(255, 255, 255, 0.22) !important;
    transform: translateY(-2px) !important;
}

#admin-login-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Login Alert */
#admin-login-alert {
    margin: 0 !important;
    border-radius: 8px !important;
}

/* ============ DASHBOARD ============ */

/* Tab navigation */
.admin-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0;
}

.admin-tab-btn {
    background: none !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    color: rgba(255, 255, 255, 0.45) !important;
    font-size: 0.75rem !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    padding: 0.5rem 1rem 0.6rem !important;
    cursor: pointer !important;
    transition: color 0.2s, border-color 0.2s !important;
    margin-bottom: -1px;
    border-radius: 0 !important;
    line-height: normal !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.admin-tab-btn:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.admin-tab-btn.active {
    color: #fff !important;
    border-bottom-color: #fff !important;
}

/* Tab panes */
.admin-tab-pane {
    display: none;
}

.admin-tab-pane.active {
    display: block;
}

/* Dashboard header */
.admin-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.admin-dash-header h3 {
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    border: none;
    padding: 0;
}

#admin-logout-btn {
    font-size: 0.7rem !important;
    padding: 0.35rem 0.9rem !important;
    border-radius: 6px !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.6) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}



#admin-logout-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

/* Project list */
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.admin-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-list-item img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.admin-list-item .item-info {
    flex: 1;
    min-width: 0;
}

.admin-list-item .item-info strong {
    display: block;
    color: #fff;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-list-item .item-info span {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
}

.admin-btn.delete {
    font-size: 0.68rem !important;
    padding: 0.28rem 0.6rem !important;
    border-radius: 5px !important;
    border: 1px solid rgba(255, 75, 75, 0.35) !important;
    background: transparent !important;
    color: rgba(255, 110, 110, 0.85) !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    flex-shrink: 0;
    white-space: nowrap;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    line-height: 1.4 !important;
}

.admin-btn.delete:hover {
    background: rgba(255, 50, 50, 0.12) !important;
    border-color: rgba(255, 75, 75, 0.65) !important;
    color: #ff8080 !important;
}

/* Form fields */
.admin-field {
    margin-bottom: 0.9rem;
}

.admin-field label {
    display: block !important;
    font-size: 0.7rem !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.45) !important;
    margin-bottom: 0.4rem !important;
    border: none !important;
    padding: 0 !important;
}

.admin-field input[type="text"],
.admin-field input[type="url"],
.admin-field textarea {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    padding: 0.65rem 0.9rem !important;
    color: #fff !important;
    font-size: 0.88rem !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: border-color 0.2s, background 0.2s !important;
    resize: vertical;
}

.admin-field input:focus,
.admin-field textarea:focus {
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.admin-field textarea {
    min-height: 70px;
}

/* Image picker grid */
.img-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    padding: 2px;
}

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

.img-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.img-picker-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.img-picker-item.selected {
    border-color: #fff;
}

.img-picker-item .img-check {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #111;
}

.img-picker-item.selected .img-check {
    display: flex;
}

/* Upload area */
.upload-drop-area {
    border: 2px dashed rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 0.8rem;
    position: relative;
}

.upload-drop-area:hover,
.upload-drop-area.drag-over {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.03);
}

.upload-drop-area p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin: 0.3rem 0 0;
}

.upload-drop-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Upload preview */
#upload-preview {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    margin-bottom: 0.8rem;
}

#upload-preview img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
}

#upload-preview .upload-info {
    flex: 1;
}

#upload-preview .upload-info span {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    display: block;
}

#upload-preview .upload-info strong {
    font-size: 0.85rem;
    color: #fff;
}

/* Primary action button */
.admin-primary-btn {
    width: 100% !important;
    padding: 0.85rem 1rem !important;
    background: #fff !important;
    color: #111 !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin: 0.2rem 0 0 0 !important;
    box-shadow: 0 3px 15px rgba(255, 255, 255, 0.08) !important;
    display: block !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

.admin-primary-btn:hover {
    background: #e8e8e8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.18) !important;
}

.admin-primary-btn:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Action alerts */
.admin-action-alert {
    border-radius: 8px !important;
    margin-top: 0.6rem !important;
}

/* Upload progress */
.upload-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.upload-progress-bar {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Selected image display */
.selected-img-preview {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 7px;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
}

.selected-img-preview img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
}