/* Custom animations for the portfolio site */

/* Notification styling */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 20px;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
    transform: translateY(100px);
    opacity: 0;
    max-width: 300px;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    background-color: var(--success-color);
}

.notification.warning {
    background-color: var(--warning-color);
}

.notification.error {
    background-color: var(--danger-color);
}

/* Button animations */
.btn.sending {
    position: relative;
    pointer-events: none;
    background-color: var(--secondary-color);
}

.btn.sending::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    width: 15px;
    height: 15px;
    margin-top: -7.5px;
    border-radius: 50%;
    border: 2px solid white;
    border-top-color: transparent;
    animation: rotate 1s infinite linear;
}

.btn.success {
    background-color: var(--success-color);
}

/* Tooltip styling */
.tooltip {
    position: fixed;
    padding: 8px 12px;
    background-color: var(--dark-color);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    max-width: 200px;
    text-align: center;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--dark-color);
}

.tooltip.show {
    opacity: 0.9;
}

/* 3D Model viewer loading indicator */
.model-loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: none;
}

.model-loading-indicator .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 123, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: rotate 1s infinite linear;
    margin-bottom: 15px;
}

.model-loading-indicator p {
    color: var(--primary-color);
    font-weight: 500;
}

/* Update model error to ensure proper z-index and visibility control */
.model-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 20; /* Ensure it's above other elements */
    transition: opacity 0.3s ease;
}

.model-error.hidden {
    display: none;
}

.model-error i {
    font-size: 3rem;
    color: var(--danger-color);
    margin-bottom: 15px;
}

.model-error p {
    color: var(--dark-color);
    margin-bottom: 20px;
    font-weight: 500;
}

.retry-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background-color: var(--secondary-color);
}

/* Page transition animations */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.5s ease;
}

.page-transition.active {
    transform: translateY(0);
}

/* Hover effects for skill categories */
.skill-category ul li {
    transition: all 0.3s ease;
    position: relative;
}

.skill-category ul li:hover {
    transform: translateX(5px);
    color: var(--primary-color);
}

/* Shining effect for hero button */
.hero .btn {
    position: relative;
    overflow: hidden;
}

.hero .btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -50%;
        top: -50%;
    }
    100% {
        left: 150%;
        top: 150%;
    }
}
