/* 违章代码查询页面样式 */

/* 搜索区域样式 */
.search-area {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    color: white;
}

.search-title {
    font-size: 2em;
    margin: 0 0 10px 0;
    text-align: center;
    color: white;
    font-weight: 600;
}

.search-subtitle {
    text-align: center;
    margin: 0 0 25px 0;
    opacity: 0.95;
    font-size: 1.05em;
}

.search-form {
    max-width: 800px;
    margin: 0 auto;
}

.search-input-group {
    position: relative;
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 18px 25px;
    font-size: 1.1em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.search-input::placeholder {
    color: #999;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: -10px;
    padding-top: 10px;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f5f7fa;
}

.search-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 消息提示样式 */
#message-container {
    margin: 20px 0;
}

.message {
    padding: 15px 20px;
    border-radius: 10px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* 常见违章代码列表样式 */
.common-codes-section {
    margin: 40px 0;
}

.section-title {
    font-size: 1.8em;
    margin: 0 0 10px 0;
    color: #333;
    text-align: center;
    font-weight: 600;
}

.section-subtitle {
    text-align: center;
    color: #666;
    margin: 0 0 25px 0;
}

.codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.code-item {
    display: block;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-weight: 500;
}

.code-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 全宽布局 */
.full-width {
    width: 100%;
    max-width: 100%;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .codes-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .search-area {
        padding: 25px 20px;
    }

    .search-title {
        font-size: 1.5em;
    }

    .search-subtitle {
        font-size: 0.95em;
    }

    .search-input {
        padding: 15px 20px;
        font-size: 1em;
    }

    .search-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        padding: 12px 30px;
        font-size: 1em;
    }

    .codes-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .code-item {
        padding: 12px 15px;
        font-size: 0.9em;
    }

    .section-title {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .search-area {
        padding: 20px 15px;
    }

    .search-title {
        font-size: 1.3em;
    }

    .codes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .code-item {
        padding: 10px 12px;
        font-size: 0.85em;
    }
}

/* 打印样式 */
@media print {
    .search-area,
    .search-buttons,
    .bottom-recommendations {
        display: none;
    }

    .codes-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .code-item {
        border: 1px solid #ddd;
        background: white;
    }
}
