@tailwind base;
@tailwind components;
@tailwind utilities;

body {
    background: linear-gradient(to right, #0f172a, #0a1220);
    color: #fff;
    font-family: 'Roboto', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    padding-top: 90px;
    margin: 0;
}

.top-navigation-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    padding: 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.nav-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid rgba(34, 197, 94, 0.3);
    border-radius: 50px;
    color: #22c55e;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: visible;
    outline: none !important;
}

.nav-button::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50px;
    padding: 4px;
    background: linear-gradient(135deg, #22c55e, #16a34a, #22c55e);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.nav-button:hover::before {
    opacity: 1;
    animation: neonGlow 2s ease-in-out infinite;
}

.nav-button:hover {
    transform: translateY(-8px);
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    box-shadow: 
        0 8px 30px rgba(34, 197, 94, 0.4),
        0 0 40px rgba(34, 197, 94, 0.3);
}

.nav-button.active {
    background: rgba(34, 197, 94, 0.25);
    border-color: #22c55e;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.nav-button.active::before {
    opacity: 0.5;
}

.nav-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) saturate(100%) invert(70%) sepia(63%) saturate(482%) hue-rotate(83deg) brightness(95%) contrast(89%);
    transition: transform 0.3s ease;
}

.nav-button:hover .nav-icon {
    transform: rotate(360deg) scale(1.1);
}

@keyframes neonGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px #22c55e) drop-shadow(0 0 15px #22c55e);
    }
    50% {
        filter: drop-shadow(0 0 15px #22c55e) drop-shadow(0 0 25px #16a34a);
    }
}

@media(max-width: 640px) {
    body {
        padding-top: 70px;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .nav-container {
        padding: 10px 16px;
    }
    
    .nav-logo {
        height: 35px;
    }
    
    .nav-button {
        padding: 10px 18px;
        font-size: 0.9rem;
        gap: 8px;
    }
    
    .nav-button span {
        display: none;
    }
    
    .nav-icon {
        width: 20px;
        height: 20px;
    }
}

.grid {
    display: grid;
    gap: 1rem;
    width: 100%;
    max-width: 1200px;
    grid-template-columns: 1fr;
    margin: 0 auto;
}

@media(min-width:640px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(min-width:1024px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
    border-radius: 1.25rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(12px);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    height: 100%;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.1), transparent);
    transition: left 0.5s;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.7),
        0 0 0 2px rgba(34, 197, 94, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(145deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.05));
    border-color: rgba(34, 197, 94, 0.5);
}

.card-title {
    font-size: clamp(1.05rem, 4vw, 1.35rem);
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 1rem;
    transition: color 0.3s;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card:hover .card-title {
    color: #22c55e;
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

.tutorial-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    align-self: flex-start;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    width: auto;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}

.tutorial-btn::after {
    content: '📖';
    margin-left: 6px;
}

.tutorial-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.tutorial-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    padding: clamp(2rem, 4vw, 2.5rem);
    border-radius: 1.5rem;
    width: 95%;
    max-width: 480px;
    text-align: center;
    position: relative;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(34, 197, 94, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(34, 197, 94, 0.3);
    transform: scale(0.8) translateY(-30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    opacity: 0;
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

#closeModalX {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    z-index: 10;
    font-weight: bold;
    line-height: 1;
}

#closeModalX:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

#closeModalX:active {
    transform: rotate(90deg) scale(0.95);
}

#modalPromptText {
    font-size: 1.125rem;
    color: #e2e8f0;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
    font-weight: 600;
}

#promptButtons,
#languageButtons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

@media(min-width: 640px) {
    #promptButtons,
    #languageButtons {
        flex-direction: row;
    }
}

.modal-content button {
    position: relative;
    padding: 0.875rem 1.75rem;
    border-radius: 0.875rem;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    outline: none !important;
}

#promptButtons button,
#languageButtons button {
    flex: 1;
    min-width: 130px;
}

#closeModal {
    width: 160px;
    margin: 0 auto;
    margin-top: 1rem;
}

@media(max-width: 640px) {
    #promptButtons button,
    #languageButtons button,
    #closeModal {
        width: 100%;
    }
}

.modal-content button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.modal-content button:hover::before {
    width: 300px;
    height: 300px;
}

.modal-content button:hover {
    transform: translateY(-3px) scale(1.05);
}

.modal-content button:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-yes-prompt {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-yes-prompt:hover {
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.6);
    background: linear-gradient(135deg, #059669, #047857);
}

.btn-no-prompt {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-no-prompt:hover {
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.6);
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.btn-persian {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-persian:hover {
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.6);
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.btn-english {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-english:hover {
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.6);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.btn-close {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.btn-close:hover {
    box-shadow: 0 6px 25px rgba(249, 115, 22, 0.6);
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

#ideaForm input,
#ideaForm textarea {
    transition: all 0.3s ease;
}

#ideaForm input:focus,
#ideaForm textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

#ideaForm button[type="submit"] {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#ideaForm button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
}

#ideaForm button[type="submit"]:active {
    transform: translateY(-1px);
}

#ideaForm button[type="submit"]:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
}

#ajaxMessage {
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.4s ease;
    background: rgba(0, 0, 0, 0.4);
    border-left: 5px solid currentColor;
    animation: slideDown 0.4s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

.davood-bar {
    position: fixed;
    right: 15px;
    bottom: 15px;
    background: linear-gradient(145deg, #1abc9c, #16a085);
    color: white;
    border-radius: 20px;
    padding: 16px;
    width: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.davood-bar:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

.davood-bar img.profile {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    margin-bottom: 10px;
    transition: transform 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.davood-bar:hover img.profile {
    transform: scale(1.08) rotate(5deg);
}

.davood-bar h3 {
    margin: 0;
    font-size: 15px;
    text-align: center;
    font-weight: 600;
}

.davood-bar p {
    margin: 3px 0 5px 0;
    font-size: 12px;
    text-align: center;
    line-height: 1.3;
}

.davood-bar .social-icons {
    display: flex;
    gap: 6px;
    margin-top: 5px;
    align-items: center;
}

.social-icons img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.social-icons img:hover {
    transform: scale(1.2) translateY(-3px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.social-icons a {
    display: inline-block;
    transition: all 0.3s;
}

#closeCreatorBar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 50%;
    color: #ef4444;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

#closeCreatorBar:hover {
    background: rgba(239, 68, 68, 0.4);
    border-color: #ef4444;
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

@media(max-width: 640px) {
    .davood-bar {
        width: 180px;
        padding: 10px;
        right: 10px;
        bottom: 10px;
    }

    .davood-bar img.profile {
        width: 60px;
        height: 60px;
    }

    .davood-bar h3 {
        font-size: 14px;
    }

    .davood-bar p {
        font-size: 11px;
    }
}

/* حذف outline از همه لینک‌ها و دکمه‌ها */
.nav-button:focus {
    outline: none !important;
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.4), 0 0 40px rgba(34, 197, 94, 0.3) !important;
}

.nav-button:focus-visible {
    outline: none !important;
}

a:focus,
button:focus,
a:focus-visible,
button:focus-visible {
    outline: none !important;
}

.nav-button::-moz-focus-inner {
    border: 0 !important;
}

.nav-button:active {
    outline: none !important;
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.4), 0 0 40px rgba(34, 197, 94, 0.3) !important;
}
