/**
 * User Profile Page Styles
 * Modern design matching kvikmyndir.is design language
 */

:root {
    --up-primary: #f1633b;
    --up-primary-dark: #d94f2a;
    --up-bg-main: #f5f5f5;
    --up-bg-card: #ffffff;
    --up-text: #333333;
    --up-text-muted: #666666;
    --up-border: rgba(0,0,0,0.1);
    --up-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --up-radius: 8px;
    --up-transition: 0.25s ease;
}

/* Profile Container */
.user-profile {
    background: var(--up-bg-main);
    padding: 30px 0;
    min-height: 60vh;
}

.user-profile__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Profile Header */
.user-profile__header {
    background: var(--up-bg-card);
    border-radius: var(--up-radius);
    box-shadow: var(--up-shadow);
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.user-profile__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--up-primary) 0%, var(--up-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-profile__info h1 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 600;
    color: var(--up-text);
}

.user-profile__stats {
    display: flex;
    gap: 24px;
    color: var(--up-text-muted);
    font-size: 14px;
}

.user-profile__stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-profile__stat strong {
    color: var(--up-text);
}

/* Section Styles */
.user-profile__section {
    background: var(--up-bg-card);
    border-radius: var(--up-radius);
    box-shadow: var(--up-shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.user-profile__section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--up-border);
}

.user-profile__section-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--up-text);
}

.user-profile__section-link {
    color: var(--up-primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--up-transition);
}

.user-profile__section-link:hover {
    color: var(--up-primary-dark);
    text-decoration: underline;
}

/* Movie Grid */
.user-profile__movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.user-profile__movie-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a1a;
    transition: transform var(--up-transition), box-shadow var(--up-transition);
}

.user-profile__movie-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Remove button */
.user-profile__movie-remove {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    max-width: 28px;
    max-height: 28px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.user-profile__movie-item:hover .user-profile__movie-remove {
    opacity: 1;
}

.user-profile__movie-remove:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

.user-profile__movie-remove:active {
    transform: scale(0.95);
}

/* Removing state */
.user-profile__movie-item.is-removing {
    opacity: 0.5;
    pointer-events: none;
}

.user-profile__movie-item.is-removed {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.user-profile__movie-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.user-profile__movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

.user-profile__movie-title {
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.user-profile__movie-ratings {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.user-profile__movie-rating {
    background: rgba(0,0,0,0.85);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-profile__movie-rating--user {
    color: #f1c40f;
    letter-spacing: 1px;
}

.user-profile__movie-rating--imdb {
    color: #fff;
}

.user-profile__rating-icon {
    width: 24px;
    height: auto;
    opacity: 0.9;
}

/* Empty State */
.user-profile__empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--up-text-muted);
}

.user-profile__empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.user-profile__empty p {
    margin: 0 0 16px 0;
    font-size: 15px;
}

.user-profile__empty-link {
    display: inline-block;
    background: var(--up-primary);
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--up-transition);
}

.user-profile__empty-link:hover {
    background: var(--up-primary-dark);
    color: #fff;
}

/* Login Prompt */
.user-profile__login-prompt {
    background: var(--up-bg-card);
    border-radius: var(--up-radius);
    box-shadow: var(--up-shadow);
    padding: 60px 40px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.user-profile__login-prompt h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
    color: var(--up-text);
}

.user-profile__login-prompt p {
    margin: 0 0 24px 0;
    color: var(--up-text-muted);
}

/* Settings Form */
.kvik-settings__form {
    max-width: 500px;
}

.kvik-settings__field {
    margin-bottom: 20px;
}

.kvik-settings__field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--up-text);
    font-size: 14px;
}

.kvik-settings__field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color var(--up-transition), box-shadow var(--up-transition);
}

.kvik-settings__field input:focus {
    outline: none;
    border-color: var(--up-primary);
    box-shadow: 0 0 0 3px rgba(241, 99, 59, 0.1);
}

.kvik-settings__divider {
    margin: 30px 0 20px;
    padding-top: 20px;
    border-top: 1px solid var(--up-border);
    font-size: 14px;
    color: var(--up-text-muted);
}

.kvik-settings__actions {
    margin-top: 30px;
}

.kvik-settings__submit {
    background: var(--up-primary);
    color: #fff;
    border: none;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--up-transition);
}

.kvik-settings__submit:hover {
    background: var(--up-primary-dark);
}

.kvik-settings__message {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-size: 14px;
}

.kvik-settings__message--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.kvik-settings__message--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Streaming Services Picker (Settings page) */
.kvik-settings__hint {
    font-size: 0.88rem;
    color: var(--up-text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.kvik-settings__services {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kvik-settings__service-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid var(--up-border, #ddd);
    border-radius: 8px;
    background: var(--up-card-bg, #fff);
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--up-text-muted, #777);
    transition: all 0.15s ease;
    opacity: 0.65;
}

.kvik-settings__service-btn:hover {
    opacity: 1;
    border-color: var(--up-primary, #f1633b);
}

.kvik-settings__service-btn--active {
    opacity: 1;
    border-color: var(--up-primary, #f1633b);
    background: rgba(241, 99, 59, 0.08);
    color: var(--up-text, #222);
}

.kvik-settings__service-btn--active .kvik-settings__service-check {
    display: inline;
}

.kvik-settings__service-btn--saving {
    pointer-events: none;
    opacity: 0.4;
}

.kvik-settings__service-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.kvik-settings__service-name {
    font-weight: 500;
}

.kvik-settings__service-check {
    display: none;
    color: var(--up-primary, #f1633b);
    font-weight: bold;
    margin-left: 2px;
}

.kvik-settings__services-status {
    display: none;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--up-text-muted, #777);
}

.kvik-settings__services-status--ok {
    color: #28a745;
}

.kvik-settings__services-status--error {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .user-profile__header {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .user-profile__stats {
        justify-content: center;
    }

    .user-profile__movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .user-profile__section {
        padding: 16px;
    }

    .kvik-settings__form {
        max-width: 100%;
    }

    .user-profile__review {
        flex-direction: column;
        gap: 0.75rem;
    }

    .user-profile__review-movie {
        width: 60px;
    }
}

/* ========================================
   USER REVIEWS SECTION
   ======================================== */

.user-profile__reviews {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-profile__review {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: var(--up-radius);
    border: 1px solid var(--up-border);
    transition: box-shadow var(--up-transition);
}

.user-profile__review:hover {
    box-shadow: var(--up-shadow);
}

.user-profile__review--pending {
    border-left: 3px solid #ffc107;
    background: #fffdf5;
}

.user-profile__review--approved {
    border-left: 3px solid #28a745;
}

.user-profile__review-movie {
    flex-shrink: 0;
    width: 80px;
}

.user-profile__review-poster-link {
    display: block;
}

.user-profile__review-poster {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.user-profile__review-content {
    flex: 1;
    min-width: 0;
}

.user-profile__review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.user-profile__review-movie-title {
    color: var(--up-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color var(--up-transition);
}

.user-profile__review-movie-title:hover {
    color: var(--up-primary-dark);
}

.user-profile__review-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.user-profile__review-badge--pending {
    background: #fff3cd;
    color: #856404;
}

.user-profile__review-badge--approved {
    background: #d4edda;
    color: #155724;
}

.user-profile__review-rating {
    color: #f1c40f;
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 0.25rem;
}

.user-profile__review-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--up-text);
}

.user-profile__review-text {
    margin: 0 0 0.5rem;
    color: var(--up-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.user-profile__review-date {
    font-size: 0.8rem;
    color: #999;
}

.user-profile__review-delete {
    margin-top: 0.5rem;
    padding: 0.35rem 0.7rem;
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.user-profile__review-delete:hover:not(:disabled) {
    background: #dc3545;
    color: #fff;
}

.user-profile__review-delete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}



/* My Ratings Section */
.user-profile__section--ratings {
    margin-top: 1rem;
}

.user-profile__ratings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.user-profile__ratings-item {
    background: var(--up-bg-card);
    border-radius: var(--up-radius);
    overflow: hidden;
    box-shadow: var(--up-shadow);
    transition: transform var(--up-transition);
}

.user-profile__ratings-item:hover {
    transform: translateY(-2px);
}

.user-profile__ratings-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    text-decoration: none;
    color: var(--up-text);
}

.user-profile__ratings-poster {
    width: 45px;
    height: 67px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.user-profile__ratings-info {
    flex: 1;
    min-width: 0;
}

.user-profile__ratings-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--up-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.user-profile__ratings-stars {
    display: flex;
    align-items: center;
    gap: 1px;
    font-size: 0.85rem;
}

.user-profile__ratings-stars .star-filled {
    color: #f1c40f;
}

.user-profile__ratings-stars .star-empty {
    color: #ddd;
}

.user-profile__ratings-value {
    font-size: 0.7rem;
    color: var(--up-text-muted);
    margin-left: 6px;
}

@media (max-width: 600px) {
    .user-profile__ratings-grid {
        grid-template-columns: 1fr;
    }
}

/* Compact badges strip (sits under the profile header) */
.user-profile__badges-strip {
    background: var(--up-bg-card);
    border-radius: var(--up-radius);
    box-shadow: var(--up-shadow);
    padding: 10px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.user-profile__badges-strip-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--up-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-profile__badges-strip-icons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.user-profile__badges-strip-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.user-profile__badges-strip-count {
    font-size: 0.8rem;
    color: var(--up-text-muted);
    margin-left: auto;
}

.user-profile__badges-strip-link {
    font-size: 0.85rem;
    color: var(--up-primary);
    text-decoration: none;
    font-weight: 500;
}

.user-profile__badges-strip-link:hover {
    text-decoration: underline;
}

/* Compact summary cards row (Hef séð + Mínar einkunnir) */
.user-profile__summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.user-profile__summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--up-bg-card);
    border-radius: var(--up-radius);
    box-shadow: var(--up-shadow);
    padding: 14px 16px;
    text-decoration: none;
    color: var(--up-text);
    transition: transform var(--up-transition), box-shadow var(--up-transition);
}

.user-profile__summary-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.user-profile__summary-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.user-profile__summary-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-profile__summary-label {
    font-size: 0.85rem;
    color: var(--up-text-muted);
}

.user-profile__summary-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--up-text);
}

.user-profile__summary-arrow {
    color: var(--up-primary);
    font-size: 1.1rem;
}

@media (max-width: 600px) {
    .user-profile__summary {
        grid-template-columns: 1fr;
    }
}