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

/* Custom colors - 与原型一致 */
:root {
    --color-brand: #239CD3;
    --color-brand-dark: #1a7ba8;
    --color-agro: #498729;
    --color-agro-light: #F5F7F4;
    --color-text-primary: #333333;
    --color-text-secondary: #777777;
    --color-border-gray: #DDDDDD;
}

/* Tailwind 自定义颜色类 */
.text-brand { color: #239CD3; }
.text-brand-dark { color: #1a7ba8; }
.text-agro { color: #498729; }
.bg-brand { background-color: #239CD3; }
.bg-brand-dark { background-color: #1a7ba8; }
.bg-agro { background-color: #498729; }
.bg-agro-light { background-color: #F5F7F4; }
.border-brand { border-color: #239CD3; }
.border-agro { border-color: #498729; }
.border-border-gray { border-color: #DDDDDD; }
.text-text-primary { color: #333333; }
.text-text-secondary { color: #777777; }

/* Hover状态 */
.hover\:text-brand:hover { color: #239CD3; }
.hover\:bg-brand:hover { background-color: #239CD3; }
.hover\:bg-brand\/90:hover { background-color: rgba(35, 156, 211, 0.9); }
.hover\:bg-agro\/90:hover { background-color: rgba(73, 135, 41, 0.9); }
.hover\:bg-agro-light:hover { background-color: #F5F7F4; }
.hover\:border-brand:hover { border-color: #239CD3; }

/* 自定义字体大小 (与原型一致) */
.text-\[26px\] { font-size: 26px; }
.text-\[32px\] { font-size: 32px; }
.text-\[38px\] { font-size: 38px; }
.text-\[14px\] { font-size: 14px; }
.text-\[16px\] { font-size: 16px; }
.text-\[18px\] { font-size: 18px; }
.text-\[22px\] { font-size: 22px; }
.text-\[25px\] { font-size: 25px; }
.text-\[28px\] { font-size: 28px; }
.text-\[13px\] { font-size: 13px; }
.text-\[15px\] { font-size: 15px; }
.text-\[11px\] { font-size: 11px; }
.text-\[12px\] { font-size: 12px; }

/* 响应式字体大小 */
@media (min-width: 768px) {
    .md\:text-\[32px\] { font-size: 32px; }
    .md\:text-\[16px\] { font-size: 16px; }
    .md\:text-\[25px\] { font-size: 25px; }
    .md\:text-\[14px\] { font-size: 14px; }
    .md\:text-\[12px\] { font-size: 12px; }
}

@media (min-width: 1024px) {
    .lg\:text-\[38px\] { font-size: 38px; }
    .lg\:text-\[18px\] { font-size: 18px; }
    .lg\:text-\[28px\] { font-size: 28px; }
    .lg\:text-\[15px\] { font-size: 15px; }
    .lg\:text-\[13px\] { font-size: 13px; }
}

/* 自定义样式 */
body {
    font-family: 'Inter', system-ui, sans-serif;
}

.transition-smooth {
    transition: all 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

/* Mega menu */
.mega-menu-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 64px;
    background: white;
    border-top: 1px solid #DDDDDD;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 40;
}

.mega-menu-panel::before {
    content: '';
    position: absolute;
    top: -24px;
    left: 0;
    right: 0;
    height: 24px;
}

.group:hover .mega-menu-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Loading spinner */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #239CD3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
