/* ===========================================================
   DedicaQR — Sprint 7 CSS
   Perfil público, API keys, audit log
   =========================================================== */

/* --------------------------------------------------------------- */
/* PUBLIC USER PROFILE                                              */
/* --------------------------------------------------------------- */
.user-profile-public {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.user-profile-public__hero {
    text-align: center;
    background: linear-gradient(135deg, #FFF8F5 0%, #fff 100%);
    padding: 2.5rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}
.user-profile-public__avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    margin: 0 auto 1rem;
    display: block;
}
.user-profile-public__avatar--placeholder {
    background: linear-gradient(135deg, #C9184A, #D4A24C);
    color: #fff;
    font-size: 3.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
}
.user-profile-public__name {
    font-family: 'Playfair Display', serif;
    color: #C9184A;
    font-size: 2rem;
    margin: 0 0 0.25rem;
}
.user-profile-public__badge {
    display: inline-block;
    color: #D4A24C;
    font-size: 1.2rem;
    margin-left: 0.25rem;
}
.user-profile-public__handle {
    color: #888;
    margin: 0 0 1rem;
    font-size: 1rem;
}
.user-profile-public__bio {
    color: #555;
    font-size: 1.05rem;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}
.user-profile-public__social {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.user-profile-public__social a {
    padding: 0.4rem 0.85rem;
    background: #fff;
    border: 1px solid #f1d6e0;
    border-radius: 100px;
    text-decoration: none;
    color: #C9184A;
    font-size: 0.9rem;
    transition: all 0.18s;
}
.user-profile-public__social a:hover {
    background: #FFB3C1;
    color: #fff;
    border-color: #FFB3C1;
}

.user-profile-public__deds {
    margin-bottom: 2rem;
}
.user-profile-public__deds-title {
    font-family: 'Playfair Display', serif;
    color: #444;
    font-size: 1.4rem;
    margin: 0 0 1.25rem;
}
.user-profile-public__count {
    color: #888;
    font-weight: normal;
    font-size: 1rem;
}
.user-profile-public__empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
}
.user-profile-public__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.user-profile-public__card {
    display: flex;
    gap: 0.75rem;
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.18s;
    border: 2px solid transparent;
}
.user-profile-public__card:hover {
    transform: translateY(-3px);
    border-color: #FFB3C1;
    box-shadow: 0 6px 16px rgba(201, 24, 74, 0.15);
}
.user-profile-public__card-icon {
    font-size: 2rem;
    line-height: 1;
}
.user-profile-public__card-body { flex: 1; min-width: 0; }
.user-profile-public__card-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    color: #C9184A;
    font-family: 'Playfair Display', serif;
}
.user-profile-public__card-snippet {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0 0 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.user-profile-public__card-meta {
    color: #aaa;
    font-size: 0.75rem;
}
.user-profile-public__footer {
    text-align: center;
    padding: 2rem 1rem;
    background: #fff7fa;
    border-radius: 12px;
    margin-top: 2rem;
}
.user-profile-public__footer a {
    color: #C9184A;
    font-weight: 600;
}

/* --------------------------------------------------------------- */
/* USER PROFILE EDIT                                                */
/* --------------------------------------------------------------- */
.user-username-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}
.user-username-prefix {
    background: #f8f9fa;
    padding: 0.6rem 0.75rem;
    color: #888;
    font-family: monospace;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    word-break: keep-all;
    white-space: nowrap;
    border-right: 1px solid #ddd;
}
.user-username-row input {
    border: 0 !important;
    padding: 0.6rem 0.75rem !important;
    border-radius: 0 !important;
}
@media (max-width: 540px) {
    .user-username-row { flex-direction: column; }
    .user-username-prefix { border-right: 0; border-bottom: 1px solid #ddd; font-size: 0.75rem; }
}

.form-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem;
    background: #fff7fa;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
}

/* --------------------------------------------------------------- */
/* API KEYS                                                         */
/* --------------------------------------------------------------- */
.api-key-just-created {
    border-left: 4px solid #28a745;
    background: #f3fff5;
}
.api-key-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: #1a1a2e;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}
.api-key-display code {
    color: #e6e6e6;
    font-size: 0.95rem;
    font-family: monospace;
    flex: 1;
    word-break: break-all;
}
.api-key-display button {
    background: #C9184A;
    color: #fff;
    border: 0;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.api-keys-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.api-keys-table th,
.api-keys-table td {
    padding: 0.6rem;
    text-align: left;
    border-bottom: 1px solid #f1f1f1;
}
.api-keys-table th {
    color: #6c757d;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.api-keys-table tr.is-inactive { opacity: 0.55; }
.api-keys-table code {
    background: #f5f5f5;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.api-key-form .form-row { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 768px) {
    .api-key-form .form-row { grid-template-columns: 1fr; }
}
