/*
Plugin Name: Link2Investors Custom Features
Description: Custom features for Link2Investors, including connection requests and Zoom integration.
Version: 1.0.0
Author: Your Name
*/

/* General Styling for Messages */
.pt-message-box {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: none; /* Hidden by default, shown by JS */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.pt-message-box.info {
    background-color: #e0f7fa;
    color: #00796b;
    border: 1px solid #00bcd4;
}

.pt-message-box.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.pt-message-box.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

/* Connection Request Button */
#pt-send-connection-request {
    background-color: #4CAF50; /* Green */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#pt-send-connection-request:hover:not(:disabled) {
    background-color: #45a049;
}

#pt-send-connection-request:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Connection Requests List */
#pt-connection-requests-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

#pt-connection-requests-list li {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#pt-connection-requests-list li:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#pt-connection-requests-list li .request-info {
    flex-grow: 1;
    font-size: 15px;
    color: #333;
}

#pt-connection-requests-list li .request-info strong {
    color: #007bff; /* Blue for username */
}

#pt-connection-requests-list li .request-actions button {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

#pt-connection-requests-list li .request-actions button:hover:not(:disabled) {
    transform: translateY(-1px);
}

#pt-connection-requests-list li .request-actions button.accept-connection {
    background-color: #28a745; /* Green */
    color: white;
}

#pt-connection-requests-list li .request-actions button.accept-connection:hover:not(:disabled) {
    background-color: #218838;
}

#pt-connection-requests-list li .request-actions button.reject-connection {
    background-color: #dc3545; /* Red */
    color: white;
}

#pt-connection-requests-list li .request-actions button.reject-connection:hover:not(:disabled) {
    background-color: #c82333;
}

#pt-connection-requests-list li .request-actions button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Styling for the chat header container itself */
.contact-profile {
    display: flex;
    align-items: center; /* Vertically center items */
    justify-content: space-between; /* This will push items to ends and center */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    padding: 10px; /* Uniform padding */
    min-height: 50px; /* Ensure a minimum height for the header */
    box-sizing: border-box; /* Include padding in the height calculation */
    border-bottom: 1px solid #eee; /* Visual separation */
}

.contact-profile > div:first-child {
    /* Ensure the avatar and name group is also vertically centered within its own space */
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.contact-profile > div:first-child p {
    /* Ensure the paragraph text is also vertically aligned */
    line-height: normal; /* Reset line-height to browser default for consistency */
    margin: 0 10px; /* Keep existing margins */
}


/* New container for Zoom icon and invites (grouped) */
#zoom-controls-group {
    display: flex; /* Make this a flex container */
    align-items: center; /* Vertically center its children */
    gap: 8px; /* Space between the label and the icon */
    margin-left: auto; /* Pushes this group to the far right within .contact-profile */
    flex-shrink: 0;
}

/* Zoom Icon Styling */
.zoom-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; /* Adjust size as needed */
    height: 40px; /* Adjust size as needed */
    background-color: #2d8cff; /* Zoom blue */
    border-radius: 50%; /* Circular shape */
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
    transform: translateY(-4px); /* Nudge the icon slightly more up for fine-tuning */
    /* This value might need to be adjusted by 1-2px based on exact rendering */
}

.zoom-icon-wrapper:hover {
    background-color: #0069d9; /* Darker blue on hover */
    transform: translateY(-5px); /* Slightly more lift on hover */
}

.zoom-icon-wrapper.is-loading {
    cursor: wait;
    opacity: 0.7;
}

.zoom-icon-wrapper svg {
    color: white;
    width: 24px; /* Icon size */
    height: 24px; /* Icon size */
    display: block; /* Remove any inline-block spacing */
    margin: auto; /* Center it */
}

.zoom-icon-wrapper img.zoom-icon { /* Targeting the image specifically if it's an img tag */
    width: 100%; /* Make image fill its container */
    height: 100%; /* Make image fill its container */
    object-fit: contain; /* Ensure the image fits without cropping */
    display: block; /* Remove any inline-block spacing */
    vertical-align: middle; /* Changed from top to middle for better flex interaction */
}


/* Styling for the Zoom invites label */
#zoom-invites-label {
    display: inline-block;
    font-size: 15px;
    color: #333; /* Adjust color as needed */
    font-weight: bold;
    white-space: nowrap; /* Prevent text from wrapping */
    line-height: normal; /* Reset line-height to browser default for consistency */
    transform: translateY(-2px); /* Nudge text slightly more up */
    /* This value might also need minor tweaking */
}

/* Styling for disabled Zoom icon when no invites are left */
.disabled-zoom-icon {
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}

/* Styling for the 'is typing' message to ensure it's positioned correctly */
#is_typing {
    margin-right: 15px; /* Add some space between it and the zoom elements */
    color: #777; /* Softer color */
    font-style: italic;
    font-size: 13px;
    flex-grow: 1; /* Allow it to take available space */
    text-align: right; /* Align text to the right within its flex space */
    display: none; /* Hidden by default by original JS, shown when typing */
}


/* Responsive adjustments */
@media (max-width: 768px) {
    #pt-connection-requests-list li {
        flex-direction: column;
        align-items: flex-start;
    }

    #pt-connection-requests-list li .request-actions {
        margin-top: 10px;
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    #pt-connection-requests-list li .request-actions button {
        margin-left: 0;
        margin-right: 10px;
        flex-grow: 1;
    }

    /* Adjustments for chat header on small screens */
    .contact-profile {
        flex-direction: column; /* Stack items vertically */
        align-items: flex-start; /* Align items to the start */
        height: auto; /* Allow height to adjust on small screens */
        padding: 10px; /* Uniform padding for mobile */
    }

    .contact-profile > div:first-child { /* User avatar and name group */
        margin-bottom: 10px;
    }

    #zoom-controls-group {
        width: 100%; /* Take full width */
        justify-content: flex-end; /* Push to the right within its own space */
        margin-left: 0; /* Remove auto margin */
        margin-top: 10px; /* Add space from elements above */
        transform: none; /* Reset transform for mobile */
    }

    #is_typing {
        width: 100%; /* Take full width */
        text-align: right; /* Align text to the right */
        margin-right: 0; /* Remove specific margin */
        margin-bottom: 10px; /* Space from elements below */
    }
}
