/* SpeakIT - Custom Styles */

/* Prevent horizontal overflow on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Selection color */
::selection {
    background: rgba(237, 125, 26, 0.2);
    color: #111827;
}

/* Focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* Toast animations */
.toast-enter {
    animation: slideIn 0.3s ease-out;
}

.toast-exit {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* FAQ toggle animation */
.faq-toggle svg {
    transition: transform 0.3s ease;
}

.faq-toggle.active svg {
    transform: rotate(180deg);
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse animation for status indicator */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Mobile menu animation */
#mobileMenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

#mobileMenu.open {
    max-height: 500px;
    opacity: 1;
}

/* Button hover effects */
a, button {
    transition: all 0.2s ease;
}

/* Card hover effect */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* Table responsive */
@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }
}

/* Form validation styles */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #22c55e;
}

/* Placeholder text */
::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Select dropdown styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Image placeholder hover effect */
.aspect-square:hover svg,
.aspect-video:hover svg {
    color: #9ca3af;
}

/* Link underline effect */
a.underline-effect {
    position: relative;
}

a.underline-effect::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ed7d1a;
    transition: width 0.3s ease;
}

a.underline-effect:hover::after {
    width: 100%;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #ed7d1a 0%, #f19a3e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card shine effect on hover */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 100%
    );
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s ease;
}

.card-shine:hover::before {
    transform: rotate(45deg) translateX(100%);
}

/* Prevent layout shift on load */
img {
    height: auto;
    max-width: 100%;
}

/* Print styles */
@media print {
    header,
    footer,
    #toastContainer {
        display: none !important;
    }

    main {
        padding-top: 0 !important;
    }

    body {
        background: white;
        color: black;
    }
}

/* Light theme card backgrounds */
.card-shine::before {
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(0, 0, 0, 0.02) 50%,
        transparent 100%
    );
}
