/* Referral Table Styles */
.referral-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
    table-layout: fixed; /* Ensure the table columns are evenly distributed */
}

/* Table Header and Data Cell Styles */
.referral-table th,
.referral-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
    word-wrap: break-word; /* Allow text to wrap in smaller cells */
}

/* Table Header Styles */
.referral-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* Zebra Striping */
.referral-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.referral-table tr:hover {
    background-color: #f0f0f0;
}

/* Commission Column Styles */
.commission {
    color: #28a745;
    font-weight: bold;
}

/* Form Styles */
.referral-tracker-form {
    margin-bottom: 20px;
    
    align-items: left;
}

.referral-tracker-form input[type="email"] {
    padding: 8px;
    margin-bottom: 10px;
    width: 100% !important; /* Make input full-width on small screens */
    max-width: 100%; /* Max width for larger screens */
}

.referral-tracker-form button {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    width: 100%; /* Make button full-width on small screens */
    max-width: 40%; /* Max width for larger screens */
}

.referral-tracker-form button:hover {
    background-color: #0056b3;
}

/* No Referrals Message */
.no-referrals {
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    margin-top: 20px;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
}

/* Error Message */
.error-message {
    padding: 10px;
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
    border-radius: 4px;
    margin: 10px 0;
}

/* Referral Tracker Container */
.referral-tracker-container {
    position: relative;
    min-height: 100px;
}

/* Skill Link Cell */
.skill-link-cell {
    position: relative;
    max-width: 300px;
    overflow: hidden;
}

/* Skill Link Styles */
.skill-link {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #007bff;
    text-decoration: none;
}

.skill-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Tooltip for Skill Links */
.skill-link-cell .tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    max-width: none;
}

.skill-link-cell:hover .tooltip {
    visibility: visible;
}

/* Tooltip Arrow */
.skill-link-cell .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .referral-table {
        font-size: 12px; /* Adjust font size for smaller screens */
    }

    .referral-table th,
    .referral-table td {
        padding: 10px; /* Reduce padding for mobile */
    }

    /* Make skill link cell scrollable horizontally on small screens */
    .skill-link-cell {
        max-width: 200px; /* Reduce width */
    }

    .referral-tracker-form {
        margin-bottom: 15px;
    }

    .referral-tracker-form input[type="email"],
    .referral-tracker-form button {
        width: 100%; /* Make inputs and buttons full width */
    }
}

/* Make the referral table scrollable horizontally on small screens */
@media (max-width: 480px) {
    .referral-tracker-form button {
        width: 100% !important;
    }
    .referral-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .referral-table th,
    .referral-table td {
        white-space: nowrap; /* Prevent wrapping of table data */
    }
}
