/* assets/css/profile.css */

/* ==========================================================================
   Variables
   ========================================================================== */
.rc-profile-page {
    --prof-primary: #26A69A; /* Teal for primary actions */
    --prof-secondary: #FF6F61; /* Coral for secondary actions */
    --prof-dark: #263238;
    --prof-light: #F4F6F9;
    --prof-success: #4CAF50; /* Green for save actions */
    --prof-warning: #FFCA28;
    --prof-error: #EF5350; /* Red for destructive actions */
    --prof-pending: #2196F3; /* Blue for pending status */
    --prof-postponed: #FFB300; /* Amber for postponed status */
    --prof-delivered: #26A69A; /* Teal for delivered status */
    --prof-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --prof-base-font-size: 16px;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
.rc-profile-page {
    font-family: 'Inter', sans-serif;
    background: var(--prof-light);
    color: var(--prof-dark);
    line-height: 1.6;
    font-size: var(--prof-base-font-size);
}

.rc-profile-page .prof-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Headings */
.rc-profile-page h2 {
    color: var(--prof-dark);
    margin: 40px 0 20px;
    font-weight: 700;
    font-size: 1.75rem;
    border-bottom: 2px solid var(--prof-primary);
    padding-bottom: 10px;
    position: relative;
}

.rc-profile-page h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--prof-secondary);
}

/* ==========================================================================
   Profile Container
   ========================================================================== */
.rc-profile-page .prof-profile-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    transition: var(--prof-transition);
}

.rc-profile-page .prof-profile-container:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Profile Info */
.rc-profile-page .prof-profile-info {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
}

.rc-profile-page .prof-avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    cursor: pointer;
}

.rc-profile-page .prof-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(45deg, var(--prof-primary), var(--prof-secondary));
    box-shadow: 0 8px 20px rgba(38, 166, 154, 0.3);
}

.rc-profile-page .prof-avatar-icon {
    font-size: 120px;
    color: #fff;
    background: var(--prof-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rc-profile-page .prof-avatar-text {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    border-bottom-left-radius: 60px;
    border-bottom-right-radius: 60px;
}

.rc-profile-page .prof-avatar-container:hover .prof-avatar-text {
    display: block;
}

.rc-profile-page .prof-avatar-container:hover .prof-avatar {
    opacity: 0.7;
}

/* User Meta */
.rc-profile-page .prof-user-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rc-profile-page .prof-user-meta p {
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    background: rgba(38, 166, 154, 0.05);
    transition: var(--prof-transition);
}

.rc-profile-page .prof-user-meta p:hover {
    background: rgba(38, 166, 154, 0.1);
    transform: translateX(10px);
}

.rc-profile-page .prof-user-meta strong {
    min-width: 150px;
    color: var(--prof-primary);
    font-weight: 600;
    display: inline-block;
}

/* Button Group */
.rc-profile-page .prof-button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Joined Events */
.rc-profile-page .prof-joined-events {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.rc-profile-page .prof-joined-events p {
    font-size: 1rem;
    color: var(--prof-dark);
    margin: 20px 0;
    text-align: center;
}

.rc-profile-page .prof-event-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: var(--prof-transition);
    border-left: 4px solid var(--prof-primary);
    position: relative;
    overflow: hidden;
}

.rc-profile-page .prof-event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(38, 166, 154, 0.1), transparent);
    transition: left 0.6s;
}

.rc-profile-page .prof-event-card:hover::before {
    left: 100%;
}

.rc-profile-page .prof-event-card h3 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    color: var(--prof-dark);
}

.rc-profile-page .prof-event-card p {
    margin: 8px 0;
    font-size: 0.9rem;
}

.rc-profile-page .prof-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
    color: white;
    margin-left: 8px;
}

.rc-profile-page .prof-status-badge.pending {
    background: var(--prof-pending);
}

.rc-profile-page .prof-status-badge.approved {
    background: var(--prof-success);
}

.rc-profile-page .prof-status-badge.rejected {
    background: var(--prof-error);
}

.rc-profile-page .prof-status-badge.postponed {
    background: var(--prof-postponed);
}

.rc-profile-page .prof-status-badge.delivered {
    background: var(--prof-delivered);
}

/* Rental Requests */
.rc-profile-page .prof-rental-requests {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.rc-profile-page .prof-rental-requests p {
    font-size: 1rem;
    color: var(--prof-dark);
    margin: 20px 0;
    text-align: center;
}

.rc-profile-page .prof-request-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: var(--prof-transition);
    border-left: 4px solid var(--prof-primary);
    position: relative;
    overflow: hidden;
}

.rc-profile-page .prof-request-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(38, 166, 154, 0.1), transparent);
    transition: left 0.6s;
}

.rc-profile-page .prof-request-card:hover::before {
    left: 100%;
}

.rc-profile-page .prof-request-card h3 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    color: var(--prof-dark);
}

.rc-profile-page .prof-request-card p {
    margin: 8px 0;
    font-size: 0.9rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.rc-profile-page .rc-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--prof-transition);
    position: relative;
    overflow: hidden;
    background: var(--prof-success); /* Green for save actions */
    color: white;
}

.rc-profile-page .rc-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.rc-profile-page .rc-btn:hover::after {
    width: 200px;
    height: 200px;
}

.rc-profile-page .rc-btn:hover:not(.disabled) {
    background: #388E3C; /* Darker green on hover */
    transform: scale(1.02);
}

.rc-profile-page .rc-btn:focus-visible {
    outline: 2px solid var(--prof-success);
    outline-offset: 2px;
}

.rc-profile-page .rc-btn.disabled {
    background: #B0BEC5; /* Grey for disabled state */
    cursor: not-allowed;
    opacity: 0.6;
}

.rc-profile-page .rc-btn-danger {
    background: var(--prof-error); /* Red for remove actions */
    color: white;
}

.rc-profile-page .rc-btn-danger:hover {
    background: #D32F2F; /* Darker red on hover */
    transform: scale(1.02);
}

.rc-profile-page .rc-btn-danger:focus-visible {
    outline: 2px solid var(--prof-error);
    outline-offset: 2px;
}

.rc-profile-page .prof-edit-btn {
    background: rgba(38, 166, 154, 0.1);
    color: var(--prof-primary);
    border: 2px solid var(--prof-primary);
    padding: 6px 12px;
    border-radius: 6px;
    transition: var(--prof-transition);
}

.rc-profile-page .prof-edit-btn:hover {
    background: var(--prof-primary);
    color: white;
    transform: scale(1.05);
}

.rc-profile-page .prof-edit-btn:focus-visible {
    outline: 2px solid var(--prof-primary);
    outline-offset: 2px;
}

.rc-profile-page .prof-leave-btn {
    background: linear-gradient(135deg, var(--prof-error), #FF6B6B);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--prof-transition);
}

.rc-profile-page .prof-leave-btn:hover {
    background: linear-gradient(135deg, #D32F2F, #EF5350);
    transform: scale(1.05);
}

.rc-profile-page .prof-leave-btn:focus-visible {
    outline: 2px solid var(--prof-error);
    outline-offset: 2px;
}

.rc-profile-page .prof-delete-account-btn {
    background: linear-gradient(135deg, #B71C1C, #D32F2F);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--prof-transition);
}

.rc-profile-page .prof-delete-account-btn:hover {
    background: linear-gradient(135deg, #8B0000, #B71C1C);
    transform: scale(1.05);
}

.rc-profile-page .prof-delete-account-btn:focus-visible {
    outline: 2px solid #B71C1C;
    outline-offset: 2px;
}

/* ==========================================================================
   Notifications
   ========================================================================== */
.rc-profile-page .rc-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rc-profile-page .rc-toast {
    background: var(--prof-dark);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    max-width: 300px;
    opacity: 0;
    transform: translateY(20px);
    animation: toastSlideIn 0.3s forwards, toastSlideOut 0.3s 2.7s forwards;
}

.rc-profile-page .rc-toast.success {
    background: var(--prof-success);
}

.rc-profile-page .rc-toast.error {
    background: var(--prof-error);
}

@keyframes toastSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */
.rc-profile-page .rc-profileModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.rc-profile-page .rc-profileModal.active {
    display: flex;
}

@supports not (backdrop-filter: blur(5px)) {
    .rc-profile-page .rc-profileModal {
        background: rgba(0, 0, 0, 0.7);
    }
}

.rc-profile-page .rc-modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.rc-profile-page .rc-modal-content h3 {
    margin: 0 0 20px;
    font-size: 1.5rem;
    color: var(--prof-dark);
    font-weight: 600;
    border-bottom: 1px solid var(--prof-light);
    padding-bottom: 10px;
}

.rc-profile-page .rc-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ECEFF1; /* Light background for visibility */
    border: none;
    font-size: 1.8rem;
    color: var(--prof-dark);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--prof-transition);
}

.rc-profile-page .rc-close-btn:hover {
    background: var(--prof-secondary);
    color: white;
    transform: scale(1.1);
}

.rc-profile-page .rc-close-btn:focus-visible {
    outline: 2px solid var(--prof-primary);
    outline-offset: 2px;
}

.rc-profile-page .rc-modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rc-profile-page .rc-modal-form label {
    font-size: 0.9rem;
    color: var(--prof-dark);
    font-weight: 500;
}

.rc-profile-page .rc-modal-form input,
.rc-profile-page .rc-modal-form textarea {
    padding: 10px;
    border: 1px solid var(--prof-light);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--prof-dark);
    background: rgba(38, 166, 154, 0.05);
    transition: var(--prof-transition);
}

.rc-profile-page .rc-modal-form input:focus,
.rc-profile-page .rc-modal-form textarea:focus {
    outline: none;
    border-color: var(--prof-primary);
    background: white;
    box-shadow: 0 0 5px rgba(38, 166, 154, 0.3);
}

.rc-profile-page .rc-modal-form input:focus-visible,
.rc-profile-page .rc-modal-form textarea:focus-visible {
    outline: 2px solid var(--prof-primary);
    outline-offset: 2px;
}

.rc-profile-page .rc-modal-form input:disabled {
    background: rgba(0, 0, 0, 0.1);
    cursor: not-allowed;
}

.rc-profile-page .rc-modal-message {
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-align: center;
    display: none;
}

.rc-profile-page .rc-modal-message.success {
    background: var(--prof-success);
    color: white;
    display: block;
}

.rc-profile-page .rc-modal-message.error {
    background: var(--prof-error);
    color: white;
    display: block;
}

.rc-profile-page .rc-input-group {
    margin-bottom: 15px;
}

.rc-profile-page .rc-input-field {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--prof-light);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--prof-dark);
    background: rgba(38, 166, 154, 0.05);
    transition: var(--prof-transition);
}

.rc-profile-page .rc-input-field:focus {
    outline: none;
    border-color: var(--prof-primary);
    background: white;
    box-shadow: 0 0 5px rgba(38, 166, 154, 0.3);
}

.rc-profile-page .rc-input-field:focus-visible {
    outline: 2px solid var(--prof-primary);
    outline-offset: 2px;
}

/* Photo Modal Button Group */
.rc-profile-page #photoModal .rc-button-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.rc-profile-page #photoModal .rc-button-group .rc-btn,
.rc-profile-page #photoModal .rc-button-group .rc-btn-danger {
    flex: 0 1 auto;
    min-width: 120px;
}

/* Photo Preview and Cropper */
.rc-profile-page .rc-photo-preview-container {
    margin: 20px 0;
    text-align: center;
}

.rc-profile-page .rc-photo-cropper {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
}

.rc-profile-page .rc-photo-cropper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 0.2s;
}

.rc-profile-page .rc-crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 50%, rgba(0, 0, 0, 0.7) 70%);
    pointer-events: none;
}

.rc-profile-page .rc-zoom-control {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.rc-profile-page .rc-zoom-control label {
    font-size: 0.9rem;
    color: var(--prof-dark);
}

.rc-profile-page .rc-zoom-control input[type="range"] {
    width: 200px;
}

.rc-profile-page #removePhotoBtn {
    margin-top: 15px;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */
@media (max-width: 768px) {
    .rc-profile-page {
        font-size: calc(var(--prof-base-font-size) - 2px);
    }

    .rc-profile-page .prof-wrapper {
        padding: 15px;
    }

    .rc Sic-page .prof-profile-container {
        padding: 20px;
        gap: 20px;
    }

    .rc-profile-page .prof-profile-info {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    .rc-profile-page .prof-avatar-container {
        width: 100px;
        height: 100px;
    }

    .rc-profile-page .prof-profile-img {
        font-size: 12px; /* Adjusted icon size */
    }

    .rc-profile-page .prof-avatar-text {
        font-size: 0.8rem;
        padding: 8px;
    }

    .rc-profile-page .rc-profile-list {
        align-items: center;
        text-align: center;
    }

    .rc-profile-page .prof-user-meta p {
        padding: 10px;
    }

    .rc-profile-page .rc-profile-list .rc-list-item:hover p {
        transform: none; /* Disable hover slide */
    }

    .rc-profile-page .prof-button-group {
        flex-direction: column;
        gap: 10px; /* Increased spacing */
    }

    .rc-profile-page .prof-joined-events,
    .rc-profile-page .prof-rental-requests {
        grid-template-columns: 1fr;
    }

    .rc-profile-page .rc-btn,
    .rc-profile-page .rc-btn-danger,
    .rc-profile-page .prof-edit-btn,
    .rc-profile-page .rc .rc-profile-btn,
    .rc-profile-page .prof-delete-account-btn {
        width: 100%;
        padding: 10px;
    }

    .rc-profile-page #photoModal .rc-button-group {
        flex-direction: column;
        align-items: stretch; /* Full width buttons */
        gap: 10px;
    }

    .rc-profile-page #photoModal .rc-button-group .rc-profile,
    .rc-profile-page #photoModal .rc-button-group .rc-btn-danger {
        width: 100%;
        min-width: unset;
    }

    .rc-profile-page .rc-toast {
        max-width: 90vw; /* Responsive width */
        font-size: 0.875rem;
    }

    .rc-profile-page h2 {
        font-size: 1.5rem;
        margin: 30px 0 15px;
    }

    .rc-profile-page .rc-modal-content {
        padding: 20px;
        max-width: 90vw;
    }

    .rc-profile-page .rc-photo-cropper {
        width: 250px;
        height: 250px;
    }

    .rc-profile-page .rc-zoom-control input[type="range"] {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .rc-profile-page {
        font-size: calc(var(--prof-base-font-size) - 4px);
    }

    .rc-profile-page .prof-wrapper {
        padding: 10px;
    }

    .rc-profile-page h2 {
        font-size: 1.25rem;
        margin: 20px 0 10px;
    }

    .rc-profile-page h2::after {
        width: 30px;
    }

    .rc-profile-page .rc {
        padding: 15px;
        gap: 15px;
    }

    .rc-profile-page .prof-avatar-container {
        width: 80px;
        height: 80px;
    }

    .rc-profile-page .prof-profile-img {
        font-size: 10px; /* Smaller icon */
    }

    .rc-profile-page .prof-avatar-text {
        font-size: 0.7rem;
        padding: 6px;
    }

    .rc-profile-page .rc-modal-content {
        padding: 15px;
        max-width: 95vw;
    }

    .rc-profile-page .prof-event-card,
    .rc-profile-page .prof-rental-card {
        padding: 15px;
    }

    .rc-profile-page .rc-toast {
        max-width: 80vw;
        font-size: 0.75rem;
    }

    .rc-profile-page .rc-photo-cropper {
        width: 200px;
        height: 200px;
    }

    .rc-profile-page .rc-zoom-control input[type="range"] {
        width: 120px;
    }

    .rc-profile-page .rc-close-btn {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
    }

    .rc-profile-page #photoModal .rc-button-group {
        gap: 8px;
    }

    .rc-profile-page #photoModal .rc-button-group .rc-profile,
    .rc-profile-page #photoModal .rc-button-group .rc-btn-danger {
        padding: 8px;
        font-size: 0.875rem;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .rc-profile-page .rc,
    .rc-profile-page .rc-list .item,
    .rc-profile-page .rc-button,
    .rc-profile-page .rc-profile-btn,
    .rc-profile-page .rc-card,
    .rc-profile-page .rc-rental-card,
    .rc-profile-page .rc-modal-content,
    .rc-profile-page .rc-toast,
    .rc-profile-page .rc .rc-profile-btn,
    .rc-profile-page .rc-profile-delete-btn,
    .rc-profile-page .rc-photo-cropper img {
        transition: none !important;
        animation: none !important;
    }
}