/* ============================================================
 * ServiceGO Custom Styles
 * FRONTEND.md §12 — All custom styles go here
 * ============================================================ */

/* ============================================================
 * 1. Account Settings - Status Badge Colors
 * Used in settings.html for subscription status display
 * ============================================================ */
.status-badge-active {
    background-color: #dcfce7;
    color: #16a34a;
}
.status-badge-trial {
    background-color: #fef3c7;
    color: #d97706;
}
.status-badge-past_due {
    background-color: #fee2e2;
    color: #dc2626;
}
.status-badge-cancelled {
    background-color: #f3f4f6;
    color: #6b7280;
}
.status-badge-default {
    background-color: #e5e7eb;
    color: #374151;
}

/* ============================================================
 * 2. Profile Avatar Background
 * ============================================================ */
.avatar-bg-primary {
    background: #405189;
}

/* ============================================================
 * 3. Usage Bar Colors
 * ============================================================ */
.usage-bar-green {
    background-color: #22c55e;
}
.usage-bar-yellow {
    background-color: #f59e0b;
}
.usage-bar-red {
    background-color: #ef4444;
}

/* ============================================================
 * 4. Alpine.js x-cloak
 * FRONTEND.md §12 — Required for Alpine's x-cloak directive
 * Elements with x-cloak are hidden until Alpine initializes
 * ============================================================ */
[x-cloak] {
    display: none !important;
}

/* ============================================================
 * 5. CKEditor Fixes
 * ============================================================ */
.ck-editor__editable {
    min-height: 150px;
}

/* ============================================================
 * 6. Notification Dropdown Styles
 * FRONTEND.md §20 — Bildirim dropdown'ı ve infinite scroll
 * ============================================================ */
.notification-list {
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Custom scrollbar for notification list */
.notification-list::-webkit-scrollbar {
    width: 4px;
}
.notification-list::-webkit-scrollbar-track {
    background: transparent;
}
.notification-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 9999px;
}
.notification-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Notification item hover effect */
.notification-item {
    border-bottom: 1px solid #f3f4f6;
}
.notification-item:last-child {
    border-bottom: none;
}

/* Loading spinner animation for notifications */
@keyframes notification-spin {
    to { transform: rotate(360deg); }
}
.notification-loader .animate-spin {
    animation: notification-spin 0.8s linear infinite;
}

/* ============================================================
 * 7. Button Styles (FRONTEND.md §9)
 * btn-primary / btn-secondary utility classes
 * ============================================================ */
.btn-primary {
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer !important;
    gap: 0.5rem !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: white !important;
    background-color: #3b82f6 !important;
    border-radius: 0.75rem !important;
    transition: background-color 0.15s ease !important;
    text-decoration: none !important;
    border: none !important;
    line-height: 1.25rem !important;
}
.btn-primary:hover {
    background-color: #60a5fa !important;
}
.btn-primary:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.btn-secondary {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    background-color: #e5e7eb !important;
    color: #374151 !important;
    border-radius: 0.75rem !important;
    transition: background-color 0.15s ease !important;
    text-decoration: none !important;
    border: none !important;
    line-height: 1.25rem !important;
}
.btn-secondary:hover {
    background-color: #d1d5db !important;
}

/* ============================================================
 * 8. Font utility classes
 * ============================================================ */
.poppins-regular { font-family: 'Poppins', sans-serif; font-weight: 400; }
.poppins-medium  { font-family: 'Poppins', sans-serif; font-weight: 500; }
.poppins-semibold { font-family: 'Poppins', sans-serif; font-weight: 600; }
.poppins-bold    { font-family: 'Poppins', sans-serif; font-weight: 700; }
.poppins-extrabold { font-family: 'Poppins', sans-serif; font-weight: 800; }
body { font-family: 'Inter', sans-serif; }

/* ============================================================
 * 9. Landing Page Styles (public/index.html)
 * ============================================================ */

/* Smooth scroll for anchor links */
html {
    scroll-behavior: smooth;
}

/* Landing page card hover effect */
.feature-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
}

/* Hero icon wrapper for landing page */
.landing-icon-wrapper {
    width: 6rem;
    height: 6rem;
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.feature-card:hover .landing-icon-wrapper {
    transform: scale(1.05) rotate(-2deg);
}

/* Step connector line — connects all 3 step circles */
.step-connector {
    position: absolute;
    top: 2rem;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(to right, transparent 2%, #e5e7eb 6%, #e5e7eb 94%, transparent 98%);
}
@media (min-width: 1024px) {
    .step-connector {
        left: 8.33%;
        width: 83.33%;
    }
}
@media (max-width: 768px) {
    .step-connector {
        display: none;
    }
}

/* Pricing card highlight */
.pricing-popular {
    position: relative;
}
.pricing-popular::before {
    content: 'POPÜLER';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #3b82f6;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 2px 16px;
    border-radius: 9999px;
    text-transform: uppercase;
}

/* Testimonial card */
.testimonial-card {
    transition: all 0.3s ease;
}
.testimonial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.08);
}

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

/* Blob shape for hero background */
.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
}

/* Demo form input focus */
.demo-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Mobile nav animation */
@keyframes mobileNavFade {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.mobile-nav-enter {
    animation: mobileNavFade 0.2s ease-out both;
}

/* Hero section responsive */
.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.15;
}
.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
}

/* Floating animation for hero icon */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}
.hero-float-icon {
    animation: float 4s ease-in-out infinite;
}

/* ============================================================
 * 10. Avatar Circle Fix - guarantee perfect circle
 * ============================================================ */
.avatar-circle {
    width: 4rem !important;
    height: 4rem !important;
    border-radius: 9999px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* When avatar-circle is used directly on an img element */
img.avatar-circle {
    width: 4rem !important;
    height: 4rem !important;
    min-width: 4rem !important;
    min-height: 4rem !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 9999px !important;
}

/* ============================================================
 * 11. Payment Result Page (account/payment_result.html)
 * Çizilen ikon animasyonu + kademeli içerik girişi.
 * Sayfa PayTR iframe'i içinde ve tam sayfa olarak render edilir.
 * ============================================================ */

/* İkon çemberi ve işaret: stroke çizim animasyonu */
.pr-icon-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: pr-draw 0.6s ease-out 0.15s forwards;
}
.pr-icon-mark {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: pr-draw 0.35s ease-out 0.65s forwards;
}
@keyframes pr-draw {
    to { stroke-dashoffset: 0; }
}

/* İkon kapsayıcısı: hafif pop giriş */
.pr-pop {
    animation: pr-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes pr-pop {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* Başlık, kart ve butonlar: kademeli fade-up */
.pr-fade-up {
    animation: pr-fade-up 0.5s ease-out both;
}
.pr-delay-1 { animation-delay: 0.30s; }
.pr-delay-2 { animation-delay: 0.45s; }
.pr-delay-3 { animation-delay: 0.60s; }
@keyframes pr-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pr-icon-circle,
    .pr-icon-mark {
        animation: none;
        stroke-dashoffset: 0;
    }
    .pr-pop,
    .pr-fade-up {
        animation: none;
    }
}


/* ============================================================
 * 12. Landing Screenshot Frames (public/index.html)
 * Gerçek ürün ekran görüntüleri: tarayıcı çerçevesi (hero),
 * yüzen telefon çerçevesi ve tanıtım (showcase) kartları.
 * ============================================================ */

/* Browser mockup frame wrapping a product screenshot */
.landing-browser-frame {
    background: #ffffff;
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 1rem;
    box-shadow: 0 25px 60px -12px rgba(59, 130, 246, 0.25);
    overflow: hidden;
}

/* Browser top bar: traffic-light dots + address pill */
.landing-browser-bar {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 0.875rem;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}

.landing-browser-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
}

.landing-browser-url {
    flex: 1;
    max-width: 260px;
    margin-left: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.6875rem;
    color: #9ca3af;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

/* Floating phone mockup overlapping the browser frame (hero) */
.landing-phone-frame {
    position: absolute;
    bottom: -1.5rem;
    left: -1.75rem;
    width: 148px;
    border: 6px solid #1f2937;
    border-radius: 1.5rem;
    background: #1f2937;
    box-shadow: 0 20px 45px -10px rgba(17, 24, 39, 0.45);
    overflow: hidden;
    animation: float 4s ease-in-out 1.2s infinite;
}

.landing-phone-frame img {
    display: block;
    width: 100%;
    border-radius: 1.05rem;
}

/* Screenshot images always fill their frame */
.landing-browser-frame img {
    display: block;
    width: 100%;
    height: auto;
}

/* Showcase card: cropped screenshot with soft zoom on hover */
.landing-shot-card .landing-shot-viewport {
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid #f3f4f6;
}

.landing-shot-card img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.landing-shot-card:hover img {
    transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
    .landing-phone-frame,
    .hero-float-icon {
        animation: none;
    }
    .landing-shot-card:hover img {
        transform: none;
    }
}


/* ============================================================
 * 13. Demo Form Tom Select (public/index.html — Sektör seçimi)
 * Matches the .demo-input look (bg-gray-50, rounded-xl) so the
 * Tom Select control blends with the other demo form fields.
 * ============================================================ */

.demo-select-wrapper .ts-wrapper.single .ts-control {
    background-color: #f9fafb;               /* bg-gray-50 */
    border: 1px solid #e5e7eb;               /* border-gray-200 */
    border-radius: 0.75rem;                  /* rounded-xl */
    padding: 0.625rem 2.5rem 0.625rem 1rem;  /* py-2.5 px-4 + caret space */
    font-size: 0.875rem;                     /* text-sm */
    color: #374151;                          /* text-gray-700 */
    box-shadow: none;
    cursor: pointer;
    /* Chevron-down caret (Heroicons, gray-400) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 1rem 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Flip caret while dropdown is open.
   Base tom-select.css resets `background` shorthand on dropdown-active,
   so repeat/position/size must be re-declared here to avoid tiling. */
.demo-select-wrapper .ts-wrapper.single.dropdown-active .ts-control {
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m4.5 15.75 7.5-7.5 7.5 7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 1rem 1rem;
}

.demo-select-wrapper .ts-wrapper.single.focus .ts-control {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.demo-select-wrapper .ts-dropdown {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    font-size: 0.875rem;
    color: #374151;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

.demo-select-wrapper .ts-dropdown .option {
    padding: 0.625rem 1rem;
}

.demo-select-wrapper .ts-dropdown .option.active {
    background-color: #eff6ff;               /* bg-blue-50 */
    color: #2563eb;                          /* text-blue-600 */
}


/* ============================================================
 * 14. AI Assistant Chat Widget (includes/ai_widget.html)
 * Typing indicator dots — three bouncing dots while waiting
 * for the Gemini response.
 * ============================================================ */

.ai-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background-color: #9ca3af;               /* gray-400 */
    animation: ai-typing-bounce 1.2s infinite ease-in-out;
}

.ai-typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.ai-typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes ai-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}
