/* TOOLTIP BASE STYLES */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
}

.tooltip:hover {
    background: #2980b9;
}

/* TOOLTIP CONTENT - USING ::BEFORE PSEUDO-ELEMENT */
.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: normal;
    white-space: nowrap;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

/* SHOW TOOLTIP ON HOVER */
.tooltip:hover::before {
    visibility: visible;
    opacity: 1;
}

/* TOOLTIP ARROW USING ::AFTER */
.tooltip::after {
    content: "";
    position: absolute;
    z-index: 999;
    visibility: hidden;
    opacity: 0;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.tooltip:hover::after {
    visibility: visible;
    opacity: 1;
}

/* TOOLTIP TOP */
.tooltip-top::before {
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
}

.tooltip-top:hover::before {
    transform: translateX(-50%) translateY(0);
}

.tooltip-top::after {
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-top-color: #2c3e50;
    border-bottom: none;
}

.tooltip-top:hover::after {
    transform: translateX(-50%) translateY(0);
}

/* TOOLTIP BOTTOM */
.tooltip-bottom::before {
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
}

.tooltip-bottom:hover::before {
    transform: translateX(-50%) translateY(0);
}

.tooltip-bottom::after {
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    border-bottom-color: #2c3e50;
    border-top: none;
}

.tooltip-bottom:hover::after {
    transform: translateX(-50%) translateY(0);
}

/* TOOLTIP LEFT */
.tooltip-left::before {
    top: 50%;
    right: calc(100% + 12px);
    transform: translateY(-50%) translateX(10px);
}

.tooltip-left:hover::before {
    transform: translateY(-50%) translateX(0);
}

.tooltip-left::after {
    top: 50%;
    right: calc(100% + 6px);
    transform: translateY(-50%) translateX(10px);
    border-left-color: #2c3e50;
    border-right: none;
}

.tooltip-left:hover::after {
    transform: translateY(-50%) translateX(0);
}

/* TOOLTIP RIGHT */
.tooltip-right::before {
    top: 50%;
    left: calc(100% + 12px);
    transform: translateY(-50%) translateX(-10px);
}

.tooltip-right:hover::before {
    transform: translateY(-50%) translateX(0);
}

.tooltip-right::after {
    top: 50%;
    left: calc(100% + 6px);
    transform: translateY(-50%) translateX(-10px);
    border-right-color: #2c3e50;
    border-left: none;
}

.tooltip-right:hover::after {
    transform: translateY(-50%) translateX(0);
}

/* TOOLTIP STYLES VARIANTS */
.tooltip-success {
    background: #27ae60;
}

.tooltip-success:hover {
    background: #219a52;
}

.tooltip-success::before {
    background-color: #27ae60;
}

.tooltip-success::after {
    border: 6px solid transparent;
}

.tooltip-success.tooltip-top::after {
    border-top-color: #27ae60;
    border-bottom: none;
}

.tooltip-success.tooltip-bottom::after {
    border-bottom-color: #27ae60;
    border-top: none;
}

.tooltip-success.tooltip-left::after {
    border-left-color: #27ae60;
    border-right: none;
}

.tooltip-success.tooltip-right::after {
    border-right-color: #27ae60;
    border-left: none;
}

.tooltip-warning {
    background: #e74c3c;
}

.tooltip-warning:hover {
    background: #c0392b;
}

.tooltip-warning::before {
    background-color: #e74c3c;
}

.tooltip-warning::after {
    border: 6px solid transparent;
}

.tooltip-warning.tooltip-top::after {
    border-top-color: #e74c3c;
    border-bottom: none;
}

.tooltip-warning.tooltip-bottom::after {
    border-bottom-color: #e74c3c;
    border-top: none;
}

.tooltip-warning.tooltip-left::after {
    border-left-color: #e74c3c;
    border-right: none;
}

.tooltip-warning.tooltip-right::after {
    border-right-color: #e74c3c;
    border-left: none;
}

.tooltip-info {
    background: #f39c12;
}

.tooltip-info:hover {
    background: #d68910;
}

.tooltip-info::before {
    background-color: #f39c12;
}

.tooltip-info::after {
    border: 6px solid transparent;
}

.tooltip-info.tooltip-top::after {
    border-top-color: #f39c12;
    border-bottom: none;
}

.tooltip-info.tooltip-bottom::after {
    border-bottom-color: #f39c12;
    border-top: none;
}

.tooltip-info.tooltip-left::after {
    border-left-color: #f39c12;
    border-right: none;
}

.tooltip-info.tooltip-right::after {
    border-right-color: #f39c12;
    border-left: none;
}

/* TOOLTIP MULTILINE */
.tooltip-multiline::before {
    white-space: normal;
    width: 200px;
    text-align: left;
    line-height: 1.4;
}

/* TOOLTIP DELAYED */
.tooltip-delay::before,
.tooltip-delay::after {
    transition-delay: 0.5s;
}

/* TOOLTIP ANIMATED */
.tooltip-animated:hover::before {
    animation: tooltipFadeIn 0.5s ease;
}

.tooltip-animated:hover::after {
    animation: tooltipFadeIn 0.5s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* TOOLTIP WITH ICONS */
.tooltip-icon::before {
    padding-left: 25px;
    background-repeat: no-repeat;
    background-position: 8px center;
    background-size: 12px;
}

.tooltip-success.tooltip-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

.tooltip-warning.tooltip-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
}

.tooltip-info.tooltip-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
}