/*
Theme Name: SocialTrend Review
Author: Inzyou
Description: A custom theme for social trend review
Version: 1.0
*/

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');
@tailwind base;
@tailwind components;
@tailwind utilities;

/* แก้ไขปัญหา overflow และ responsive */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ปรับแต่ง container ให้ปรับขนาดอัตโนมัติ */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

@media (max-width: 1280px) {
    .container {
        max-width: 100%;
    }
}

/* ปรับแต่ง grid ให้ปรับขนาดอัตโนมัติ */
.grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* ปรับแต่งรูปภาพให้ปรับขนาดอัตโนมัติ */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ปรับแต่ง mobile menu */
#mobile-menu {
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
}

/* ปรับแต่ง font size ตามขนาดหน้าจอ */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 12px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

/* ปรับแต่งการแสดงผลของ flex items */
.flex {
    display: flex;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .flex {
        justify-content: center;
    }
}

/* Custom CSS */
body {
    font-family: 'Prompt', sans-serif;
}

.live-indicator {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.match-card:hover {
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dark-gradient {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* Search Form Styles */
.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field {
    padding: 8px 15px 8px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    outline: none;
    transition: all 0.3s ease;
    width: 200px;
    background-color: #f8fafc;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2394a3b8"><path d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 16px;
}

.search-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    width: 250px;
}

.search-submit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
}

/* Dark Mode Styles */
.dark .search-field {
    background-color: #1e293b;
    border-color: #334155;
    color: #f8fafc;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23647d8b"><path d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
}

.dark .search-submit {
    color: #94a3b8;
}

.dark .search-submit:hover {
    color: var(--primary-color);
}

/* Dark Mode Text Colors */
.dark-mode {
  color: #ffffff;
}

dark:text-white {
  color: #ffffff;
}

dark:text-gray-300 {
  color: #d1d5db;
}

dark:text-blue-400 {
  color: #60a5fa;
}

dark:text-purple-400 {
  color: #a78bfa;
}
